tag:blogger.com,1999:blog-88266083537693209192024-03-11T11:43:33.190+05:30Engineering ClinicIts all about Network Simulations (NS2, NS3), Internet of Things, Sensor Networks, Programming, Embedded Systems, Cyber Physical Systems, etcT S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.comBlogger445125tag:blogger.com,1999:blog-8826608353769320919.post-69831174078116228542024-01-10T09:17:00.003+05:302024-01-10T09:17:26.234+05:30VLAN implementation using NS2<p style="line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-size: x-large;"><b>VLAN implementation using NS2</b></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;"><br /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">HARDWARE / SOFTWARE REQUIRED:</span></p><ul class="lst-kix_z42mv61sfc8v-0 start" style="margin: 0px; padding: 0px;"><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 38.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 38.2pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Network Simulator-2</span></li><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 38.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 38.2pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">Operating System – LINUX (</span><span style="font-family: "Times New Roman"; font-size: 12pt; font-style: italic; font-weight: 700;">UBUNTU</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">)</span></li></ul><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">THEORY</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">VLAN</span><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> is a custom network that is created from one or more local area networks. It enables a group of devices available in multiple networks to be combined into one logical network. The result becomes a virtual LAN that is administered like a physical LAN. The full form of VLAN is defined as Virtual Local Area Network.</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 14pt; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The below topology depicts a network having all hosts inside the same virtual LAN:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 299.8px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 424px;"><img alt="" src="https://lh7-us.googleusercontent.com/UZppWR8RlpTJKRBp2hE7EUq3GpHuWvrlwtzXGvBZo919I8j6CcFUYO8dFXqRlj7bnRzp3ZQ6qK7LYhXWrLSdlGBqrexTJlUqtd0puBCyL40k5JbGhaIrp9tNLyRsIJ0pORV1LFbV7OnD3TaKKaMl0ew" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 299.8px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 424px;" title="" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 14pt; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Without VLANs, a broadcast sent from a host can easily reach all network devices. Each and every device will process broadcast received frames. It can increase the CPU overhead on each device and reduce the overall network security.</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 14pt; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">In case if you place interfaces on both switches into separate VLANs, a broadcast from host A can reach only devices available inside the same VLAN. Hosts of VLANs will not even be aware that the communication took place. This is shown in the below picture:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 299.8px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 444.13px;"><img alt="" src="https://lh7-us.googleusercontent.com/mRvJo0hiYn8AEOnOo_S5dYumSHevMsfUq-E4_UtDh80bps5XHMh2bijhcN0vfchbyrLWjAFxSaxNcmtmfiqV0CeDRHeh7_21mqBULQwH7S8RMrOBz6kErr5zKUfwYgQybcs_VjAgA3d5C_KTKOZ6W3w" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 299.8px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 444.13px;" title="" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="background-color: white; color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="background-color: white; color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">VLAN in networking is a virtual extension of LAN. A LAN is a group of computer and peripheral devices that are connected in a limited area such as a school, laboratory, home, or office building. It is a widely useful network for sharing resources like files, printers, games, and other applications.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 14pt; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Here are step-by-step details of how VLAN works:</span></p><ul class="lst-kix_72xvq71z7rd7-0 start" style="margin: 0px; padding: 0px;"><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 14pt; padding: 14pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">VLANs in networking are identified by a number.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">A Valid range is 1-4094. On a VLAN switch, you assign ports with the proper VLAN number.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The switch then allows data which needs to be sent between various ports having the same VLAN.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Since almost all networks are larger than a single switch, there should be a way to send traffic between two switches.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">One simple and easy way to do this is to assign a port on each network switch with a VLAN and run a cable between them.</span></li></ul><h2 style="background-color: white; break-after: avoid; color: black; font-family: Arial; font-size: 16pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; page-break-after: avoid; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">Difference between LAN and VLAN</span></h2><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><a id="t.fe6abeef1c3fe4914fc84ce7e1417e330781e6cd"></a><a id="t.0"></a><table style="border-collapse: collapse; border-spacing: 0px; margin-left: -0.8pt; margin-right: auto;"><tbody><tr style="height: 0pt;"><td colspan="1" rowspan="1" style="background-color: #f9f9f9; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(238, 238, 238); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #000000; border-top-style: solid; border-top-width: 0pt; border-width: 0pt 0pt 1pt; padding: 0.8pt; vertical-align: middle; width: 241.8pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">LAN</span></p></td><td colspan="1" rowspan="1" style="background-color: #f9f9f9; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(0, 0, 0) rgb(0, 0, 0) rgb(238, 238, 238); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #000000; border-top-style: solid; border-top-width: 0pt; border-width: 0pt 0pt 1pt; padding: 0.8pt; vertical-align: middle; width: 233.9pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">VLAN</span></p></td></tr><tr style="height: 0pt;"><td colspan="1" rowspan="1" style="background-color: white; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 241.8pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">LAN can be defined as a group of computer </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">and peripheral devices that are connected </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">in a limited area.</span></p></td><td colspan="1" rowspan="1" style="background-color: white; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 233.9pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">A VLAN can be defined as a custom network that is created from one or more local area networks.</span></p></td></tr><tr style="height: 0pt;"><td colspan="1" rowspan="1" style="background-color: #f9f9f9; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 241.8pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The full form of LAN is Local Area Network</span></p></td><td colspan="1" rowspan="1" style="background-color: #f9f9f9; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 233.9pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The full form of VLAN is Virtual Local Area Network.</span></p></td></tr><tr style="height: 0pt;"><td colspan="1" rowspan="1" style="background-color: white; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 241.8pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The latency of the LAN is high.</span></p></td><td colspan="1" rowspan="1" style="background-color: white; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 233.9pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The latency of VLAN is less.</span></p></td></tr><tr style="height: 0pt;"><td colspan="1" rowspan="1" style="background-color: #f9f9f9; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 241.8pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The cost of LAN is high.</span></p></td><td colspan="1" rowspan="1" style="background-color: #f9f9f9; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 233.9pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The cost of a VLAN is less.</span></p></td></tr><tr style="height: 0pt;"><td colspan="1" rowspan="1" style="background-color: white; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 241.8pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">In LAN, the network packet is advertised</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> to each and every device.</span></p></td><td colspan="1" rowspan="1" style="background-color: white; border-bottom-color: #eeeeee; border-bottom-style: solid; border-bottom-width: 1pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt; padding: 0.8pt; vertical-align: middle; width: 233.9pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">In VLAN, the network packet is sent to only a specific broadcast domain.</span></p></td></tr><tr style="height: 0pt;"><td colspan="1" rowspan="1" style="background-color: #f9f9f9; border-bottom-color: #000000; border-bottom-style: solid; border-bottom-width: 0pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt 0pt; padding: 0.8pt; vertical-align: middle; width: 241.8pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It uses a ring, and FDDI (Fiber </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Distributed Data Interface) is a protocol.</span></p></td><td colspan="1" rowspan="1" style="background-color: #f9f9f9; border-bottom-color: #000000; border-bottom-style: solid; border-bottom-width: 0pt; border-color: rgb(238, 238, 238) rgb(0, 0, 0) rgb(0, 0, 0); border-left-color: #000000; border-left-style: solid; border-left-width: 0pt; border-right-color: #000000; border-right-style: solid; border-right-width: 0pt; border-style: solid; border-top-color: #eeeeee; border-top-style: solid; border-top-width: 1pt; border-width: 1pt 0pt 0pt; padding: 0.8pt; vertical-align: middle; width: 233.9pt;"><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #222222; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It uses ISP and VTP as a protocol.</span></p></td></tr></tbody></table><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">MULTIPLE VLANS AND SINGLE ROUTER</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">If you have a router that supports </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"><a href="https://www.google.com/url?q=https://www.techtarget.com/searchnetworking/definition/virtual-LAN&sa=D&source=editors&ust=1704861781365519&usg=AOvVaw35MKz2wkAjokii3vgKvURU" style="color: inherit; text-decoration: inherit;">virtual LANs</a></span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> (VLANs), you can create multiple VLANs from that single router. This can be useful if you want to segment your network traffic for security or performance reasons.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">A VLAN is a logical grouping of devices on a network. VLANs are used to segment a network into smaller, more manageable pieces. VLANs are created by configuring a router or switch to divide a physical network into multiple logical networks. </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Creating a VLAN is a two-step process. First, you must create the VLAN itself. This is done by configuring a router or switch to create a new logical network. Second, you must add devices to the VLAN. This is done by configuring the router or switch to add devices to the VLAN.<br />Adding devices to a VLAN is a simple process. First, you must determine which devices you want to add to the VLAN. Second, you must configure the router or switch to add those devices to the VLAN.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Switches generate a VLAN as a broadcast domain. You, the administrator, set up some switch ports in a different VLAN than the default VLAN for the sake of convenience. VLANs are enabled in Cisco switches by default, and ALL devices are already connected to VLAN 1. If there were no additional configuration required, these devices would be unable to communicate. All devices on a switch can communicate with one another using the same ports as a single switch. Consider using VLANs if you’re having difficulty connecting to the Internet. A trunk port is shared by multiple switches or routers and is used to route traffic between them.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">VLANs can be configured in a variety of Cisco switches, even if they are in different models. To communicate with other trunks, a trunk port must use a special trunk trunk protocol. Because VLANs limit the number of broadcasts, they provide a higher level of performance to large and medium LANs. As a result, they also provide security because you effectively have one group of devices connected to a VLAN.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-weight: 700;">MULTIPLE VLANS WITH SEPARATE MULTIPLE ROUTERS</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It is possible to use multi-VLAN ports to conduct networking. These switches and routers can be used to separate groups of users, departments, and functions from one another without the need for separate switches or routers. There is a significant cost savings, improved network security and performance, and simplified management associated with this model.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">PROCEDURE</span></p><ol class="lst-kix_775443jrr7bd-0 start" start="1" style="margin: 0px; padding: 0px;"><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Create a simulator object</span></li><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Open a nam trace file and define the finish procedure then close the trace file, and execute nam on the trace file.</span></li><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Create VLANs with router(s) that form a logical network </span></li><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Create duplex links between the VLANs</span></li><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Schedule events and run the program.</span></li></ol><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; text-indent: 36pt; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Scheduling Events</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">NS is a discrete event-based simulation. The TCL script defines when the event should</span><span style="font-family: "Calibri"; font-weight: 400;"><br /></span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">occur. The initializing command set ns [new Simulator] creates an event scheduler, and events are then scheduled using the format:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 38.4px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 180.93px;"><img alt="" src="https://lh7-us.googleusercontent.com/iLJvmN3cxTP80hjXH6yLGZiyg4HlMwepoR-1h8Zisc1oRJC6t0IBIdf_6g9SYTIVlCCp4L-AH_EZmJrZJD8J-avur9ryNeiecONKB5Vk6RsQe73-zSEcSY2eBalkw_9tqHlOaYhaMbVl7zAxLqqfJZM" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 38.4px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 180.93px;" title="" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; text-indent: 36pt; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The simulation can then begin using the command </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 108pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 108pt; orphans: 2; padding: 0px; text-align: left; text-indent: 36pt; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">$ns run</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="font-family: courier; font-size: 12pt; font-weight: 700;">PROGRAM</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="font-size: 14pt;"><span style="font-family: courier;">set opt(tr) "vlandemo.tr"</span></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(namtr) "vlandemo.nam"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(seed) 0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(stop) 1.0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(node) 4</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(qsize) 100</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(bw) 10Mb</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(delay) 1ms</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(ll) LL</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(ifq) Queue/DropTail</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(mac) Mac/Csma/Cd</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#set opt(mac) Mac/Csma/Ca</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#set opt(mac) Mac/802_3</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(chan) Channel</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(tcp) TCP/Newreno</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(sink) TCPSink</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set opt(app) FTP</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">proc finish {} {</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> global ns opt</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> $ns flush-trace</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># exec nam $opt(namtr) &</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> exit 0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">}</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">proc create-trace {} {</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> global ns opt</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> if [file exists $opt(tr)] {</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> catch "exec rm -f $opt(tr) $opt(tr)-bw [glob $opt(tr).*]"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> }</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> settrfd [open $opt(tr) w]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> $ns trace-all $trfd</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> if {$opt(namtr) != ""} {</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> $ns namtrace-all [open $opt(namtr) w]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> }</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> return $trfd</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">}</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">proc create-topology {} {</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> global ns opt</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> global lan node source node0 nodex</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> set num $opt(node)</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> for {set i 0} {$i< $num} {incri} {</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> set node($i) [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> lappendnodelist $node($i)</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> }</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> set lan [$ns make-lan $nodelist $opt(bw) \</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> $opt(delay) $opt(ll) $opt(ifq) $opt(mac) $opt(chan)]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> set node0 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> $ns duplex-link $node0 $node(1) 20Mb 2ms DropTail</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># $ns duplex-link-op $node0 $node(1) orient right</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> set nodex [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> $ns duplex-link $nodex $node(2) 20Mb 2ms DropTail</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># $ns duplex-link-op $nodex $node(2) orient left</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">}</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">## MAIN ##</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ns [new Simulator]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">settrfd [create-trace]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># create-topology</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tcp0 [$ns create-connection TCP/Newreno $node0 TCPSink $nodex 0]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$tcp0 set window_ 15</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ftp0 [$tcp0 attach-app FTP]</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#set udp0 [new Agent/UDP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#$ns attach-agent $node0 $udp0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#set cbr0 [new Application/Traffic/CBR]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#$cbr0 attach-agent $udp0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#set rcvr0 [new Agent/Null]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#$ns attach-agent $nodex $rcvr0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#$udp0 set dst_ [$rcvr0 set addr_]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 0.0 "$ftp0 start"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#$ns at 0.0 "$cbr0 start"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $opt(stop) "finish"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns run</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><br /></p><p style="color: black; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="font-family: courier;"><span style="font-size: 18.6667px;"># to run the example, use the following line</span></span></p><p style="color: black; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="font-family: courier;"><span style="font-size: 18.6667px;">$ ns filename.tcl</span></span></p><p style="color: black; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="font-family: courier;"><span style="font-size: 18.6667px;">$ nam </span></span><span style="font-family: courier; font-size: 18.6667px;">vlandemo.nam</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: courier; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">OUTPUT</span></p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><img alt="VLAN in ns2" src="https://lh7-us.googleusercontent.com/iLyHafUyrLvEUd0TJv7eucwg9hhRUOcH1fobLc5K8ODhAkiP8_vjJ1tfQd4Bggw3pYLGOjlHYvBv6QV9lOheUlu5BTRwfMGg07tEPXjAXcG6CCogPfM88_CAy2wEjYAhQ2m7yULCpIYJqOUGIup6Ark=s16000" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 420.4px; margin-left: auto; margin-right: auto; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 508.07px;" title="VLAN in ns2" /></td></tr><tr><td class="tr-caption" style="text-align: center;">VLAN Demo</td></tr></tbody></table><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 420.4px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 508.07px;"><br /></span></p><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com1tag:blogger.com,1999:blog-8826608353769320919.post-20381865516640145922024-01-09T22:15:00.000+05:302024-01-09T22:15:07.026+05:30HTTP and FTP Simulation in NS2<p style="line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: Times New Roman; font-size: x-large;"><b>HTTP and FTP Simulation in NS2</b></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;"><br /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">HARDWARE / SOFTWARE REQUIRED:</span></p><ul class="lst-kix_vqeuim5r8224-0 start" style="margin: 0px; padding: 0px;"><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 38.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 38.2pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Network Simulator-2</span></li><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 38.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 38.2pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">Operating System – LINUX (</span><span style="font-family: "Times New Roman"; font-size: 12pt; font-style: italic; font-weight: 700;">UBUNTU</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">)</span></li></ul><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">THEORY:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;"><br /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">HTTP:</span></p><ul class="lst-kix_5jgkwb9386oq-0 start" style="margin: 0px; padding: 0px;"><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">HTTP stands for </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Hypertext Transfer Protocol</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It is a protocol used to access the data on the World Wide Web (www).</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The HTTP protocol can be used to transfer the data in the form of plain text, hypertext, audio, video, and so on.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">This protocol is known as HyperText Transfer Protocol because of its efficiency which allows us to use it in a hypertext environment where there are rapid jumps from one document to another document.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">HTTP is similar to FTP as it also transfers files from one host to another host. However, HTTP is simpler than FTP as HTTP uses only one connection, i.e., no control connection to transfer the files.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 14pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 14pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">HTTP is used to carry the data in the form of a MIME-like format.</span></li></ul><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 0pt; padding-left: 0; padding-right: 0; padding-top: 14pt; padding: 14pt 0px 0pt; text-align: justify; widows: 2;"><span style="color: #610b38; font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Features of HTTP:</span></p><ul class="lst-kix_xtm20kw0yhmr-0 start" style="margin: 0px; padding: 0px;"><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 10pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 10pt 0pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Connectionless protocol:</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> HTTP is a connectionless protocol. HTTP client initiates a request and waits for a response from the server. When the server receives the request, the server processes the request and sends back the response to the HTTP client after which the client disconnects the connection. The connection between client and server exists only during the current request and response time only.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 10pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 10pt 0pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Media independent:</span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"> HTTP protocol is media independent as data can be sent as long as both the client and server know how to handle the data content. It is</span><span style="font-family: "Quattrocento Sans"; font-size: 12pt; font-weight: 400;"> </span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">required for both the client and server to specify the content type in the MIME-type header.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 14pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 14pt 0pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Stateless:</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> HTTP is a stateless protocol as both the client and server know each other only during the current request. Due to the nature of the protocol, both the client and server do not retain the information between various requests of the web pages.</span></li></ul><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 281.93px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 268.13px;"><img alt="HTTP" src="https://lh7-us.googleusercontent.com/cnMQcN8MzUVum3LBIxVGh7td-Xj_6creoWT0t2wJetvP9yYCodrOgBNxeEsWPIAUav8OKgt7l39r_pu-HHUvhyynBEA_vyjsR5xf83Q3pSlninh6iVROS2qpwUJdhFgbN8607c0GwDAm5Vay-WbJ2RM=s16000" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 281.93px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 268.13px;" title="HTTP" /></span></p><h2 style="background-color: white; break-after: avoid; color: black; font-family: Arial; font-size: 16pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 14pt; padding: 14pt 0px; page-break-after: avoid; text-align: center; widows: 2;"><span style="color: #610b38; font-family: "Times New Roman"; font-size: 11pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">HTTP Transactions</span></h2><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 163.87px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 328.93px;"><img alt="Computer Network HTTP" src="https://lh7-us.googleusercontent.com/0lMdl0_iwQkNqhMnaTGtL6W0fUs9SsVzJgAp_4Q1Yfz75cMjqwyGSPfMaFntVT3fd6xVxGIhYi6EDjoW14SA_-g8bdNtODqsZh4j643airKv0eHtxOTWna_zb8DsYzOnYQi3B17AwkOUy0HCla1mcvE" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 163.87px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 328.93px;" title="" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 208px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 423.07px;"><img alt="" src="https://lh7-us.googleusercontent.com/PiETF3bioLgKlb85_X3WNoXXHnSeOF181nhtb3S40JOb3yHP--1ueMorpFu8pOZPNV2Epi7DmWWSQ9_DhH5_EmZvjtFMpMy258s8KuzWwy4lYhKCFsc4tw5LdSmsV_uHJ1goNDaPDwF5cI8uCRFqSnE" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 208px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 423.07px;" title="" /></span></p><h1 style="background-color: white; break-after: avoid; color: black; font-family: Arial; font-size: 20pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 3pt; padding-left: 0; padding-right: 0; padding-top: 3.8pt; padding: 3.8pt 0px 3pt; page-break-after: avoid; text-align: justify; widows: 2;"><span style="color: #610b38; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">FTP</span></h1><ul class="lst-kix_qvmrjpez7umz-0 start" style="margin: 0px; padding: 0px;"><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 54pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 54pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">FTP stands for File transfer protocol.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 54pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 54pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">FTP is a standard internet protocol provided by TCP/IP used for transmitting files from one host to another.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 54pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 54pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It is mainly used for transferring web page files from their creator to the computer that acts as a server for other computers on the internet.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 54pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 54pt; orphans: 2; padding-bottom: 14pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 14pt 0pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">It is also used for downloading files to computers from other servers.</span></li></ul><h2 style="background-color: white; break-after: avoid; color: black; font-family: Arial; font-size: 16pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 0pt; padding-left: 0; padding-right: 0; padding-top: 14pt; padding: 14pt 0px 0pt; page-break-after: avoid; text-align: justify; widows: 2;"><span style="color: #610b38; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">Objectives of FTP</span></h2><ul class="lst-kix_c08telmsjx4h-0 start" style="margin: 0px; padding: 0px;"><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 54pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 54pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It provides the sharing of files.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 54pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 54pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It is used to encourage the use of remote computers.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 54pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 54pt; orphans: 2; padding-bottom: 14pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 14pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It transfers the data more reliably and efficiently.</span></li></ul><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 14pt; padding: 14pt 0px; text-align: justify; widows: 2;"><span style="color: #333333; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Although transferring files from one system to another is very simple and straightforward, sometimes it can cause problems. For example, two systems may have different file conventions. Two systems may have different ways of representing text and data. Two systems may have different directory structures. FTP protocol overcomes these problems by establishing two connections between hosts. One connection is used for data transfer, and another connection is used for the control connection.</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 14pt; padding: 14pt 0px; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 281.07px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 500.27px;"><img alt="FTP" src="https://lh7-us.googleusercontent.com/o-Cc9fNXUncrgPk0lfyHugFOLx0oJJCRntAqlJsU39pPN1-Mdd9i0Fp-FqGZFNMryR28KpTGO242gXr7pPu_SbrIKsfyaIbbCxMCnClmZvl6X9xWZHUAKK2Pt0D-QujHelDmxwlQErN6r23mQP93EOY=s16000" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 281.07px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 500.27px;" title="FTP" /></span></p><h2 style="background-color: white; break-after: avoid; color: black; font-family: Arial; font-size: 16pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 14pt; padding: 14pt 0px; page-break-after: avoid; text-align: center; widows: 2;"><span style="color: #610b38; font-family: "Times New Roman"; font-size: 14pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">Mechanism of FTP</span></h2><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 14pt; padding: 14pt 0px; text-align: justify; widows: 2;"><span style="color: #333333; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The above figure shows the basic model of the FTP. The FTP client has three components: the user interface, the control process, and the data transfer process. The server has two components: the server control process and the server data transfer process.</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 14pt; padding: 14pt 0px; text-align: justify; widows: 2;"><span style="color: #333333; font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">There are two types of connections in FTP:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 176.8px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 271.93px;"><img alt="Computer Network FTP" src="https://lh7-us.googleusercontent.com/cDiSiBXJ41SbZ2sp8c2TDhw1pJASY0_dVIXZZhsgGu2N5WbnLJHk2d3Yxz6ZmEiQ9nrl8lO0-C1HxAFaT_YByw-vnd-Zh5bJcnhFITauowyPQJ539B5xYfA1q_Af6RWRlrsIOBIJvLXsh3q2icFMxio" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 176.8px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 271.93px;" title="" /></span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 14pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 14pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Control Connection:</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> The control connection uses very simple rules for communication. Through control connection, we can transfer a line of command or line of response at a time. The control connection is made between the control processes. The control connection remains connected during the entire interactive FTP session.</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 14pt; padding-left: 0; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 14pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Data Connection:</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> The Data Connection uses very complex rules as data types may vary. The data connection is made between data transfer processes. The data connection opens when a command comes for transferring the files and closes when the file is transferred.</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 0pt; padding-left: 0; padding-right: 0; padding-top: 14pt; padding: 14pt 0px 0pt; text-align: justify; widows: 2;"><span style="color: #610b38; font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">FTP Clients</span></p><ul class="lst-kix_1y98v7vzai1n-0 start" style="margin: 0px; padding: 0px;"><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">FTP client is a program that implements a file transfer protocol that allows you to transfer files between two hosts on the internet.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It allows a user to connect to a remote host and upload or download the files.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 0pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 0pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It has a set of commands that we can use to connect to a host, transfer the files between you and your host, and close the connection.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding-bottom: 14pt; padding-left: 0pt; padding-right: 0; padding-top: 3pt; padding: 3pt 0px 14pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The FTP program is also available as a built-in component in a Web browser. This GUI-based FTP client makes the file transfer very easy and also does not require remembering the FTP commands.</span></li></ul><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">ALGORITHM:</span><span style="font-family: "Times New Roman"; font-weight: 700;"><br /></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">1. Create a simulator object</span><span style="font-family: "Times New Roman"; font-weight: 400;"><br /></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">2. Open a nam trace file and define the finish procedure then close the trace file, and execute nam</span><span style="font-family: "Times New Roman"; font-weight: 400;"><br /></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"> on the trace file.</span><span style="font-family: "Times New Roman"; font-weight: 400;"><br /></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">3. Create two nodes that form a network numbered from 0 to 1</span><span style="font-family: "Times New Roman"; font-weight: 400;"><br /></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">4. Create duplex links between the nodes n(0) to n(1)</span><span style="font-family: "Times New Roman"; font-weight: 400;"><br /></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">5. Setup TCP Connection between n(0) and n(1)</span><span style="font-family: "Times New Roman"; font-weight: 400;"><br /></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">6. Apply FTP Traffic over TCP.</span><span style="font-family: "Times New Roman"; font-weight: 400;"><br /></span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">7. Schedule events and run the program</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: left; widows: 2;"><span style="font-family: courier; font-size: 12pt; font-weight: 700;">PROGRAM</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">This script is created by NSG2 beta1</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Simulation parameters setup</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-weight: 400;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">setval(stop) 10.5 ;# time of simulation end</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Initialization </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Create a ns simulator</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ns [new Simulator]</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Open the NS trace file</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tracefile [open httpex.tr w]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns trace-all $tracefile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Open the NAM trace file</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">setnamfile [open httpex.nam w]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns namtrace-all $namfile</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Nodes Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Create 6 nodes</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n0 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n1 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n2 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n3 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n4 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n5 [$ns node]</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Links Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Createlinks between nodes</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n0 $n2 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n0 $n2 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n3 $n2 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n3 $n2 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n1 $n2 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n1 $n2 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n3 $n4 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n3 $n4 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n3 $n5 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n3 $n5 50</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Give node position (for NAM)</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n0 $n2 orient right-down</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n3 $n2 orient left</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n1 $n2 orient right-up</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n3 $n4 orient right-up</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n3 $n5 orient right-down</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Agents Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tcp0 [new Agent/TCP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n0 $tcp0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set sink3 [new Agent/TCPSink]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n5 $sink3</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns connect $tcp0 $sink3</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$tcp0 set packetSize_ 1500</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tcp1 [new Agent/TCP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n4 $tcp1</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set sink2 [new Agent/TCPSink]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n1 $sink2</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns connect $tcp1 $sink2</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$tcp1 set packetSize_ 1500</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a UDP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set udp4 [new Agent/UDP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n2 $udp4</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set null5 [new Agent/Null]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n5 $null5</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns connect $udp4 $null5</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$udp4 set packetSize_ 48</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Applications Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a FTP Application over TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ftp0 [new Application/FTP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ftp0 attach-agent $tcp0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 1.0 "$ftp0 start"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 10.0 "$ftp0 stop"</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a FTP Application over TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ftp1 [new Application/FTP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ftp1 attach-agent $tcp1</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 1.0 "$ftp1 start"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 10.0 "$ftp1 stop"</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a CBR Application over UDP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set cbr2 [new Application/Traffic/CBR]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$cbr2 attach-agent $udp4</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$cbr2 set packetSize_ 48</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$cbr2 set interval_ 50ms</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$cbr2 set random_ null</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 1.0 "$cbr2 start"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 10.0 "$cbr2 stop"</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Termination </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Define a 'finish' procedure</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">proc finish {} {</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">global ns tracefilenamfile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> $ns flush-trace</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">close $tracefile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">close $namfile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">execnamhttp.nam&</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">exit 0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">}</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $val(stop) "$ns nam-end-wireless $val(stop)"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $val(stop) "finish"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $val(stop) "puts \"done\" ; $ns halt"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns run</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;"><br /></span></p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><img alt="NS2" src="https://lh7-us.googleusercontent.com/MBiLVnz_VllsUxcZw0_niUevept1lgl1pkswZev93YwZsvQdRC_8OH0-ndBbsY-R0ziJqNfimTuvIOvv5Zit0ixj-vxVNkMtZh_Lffua-HfcKwbJxyL-nbyrzSTnB-kfKkS-XEyXsKMNfaq-eVAWjqI=s16000" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 312.33px; margin-left: auto; margin-right: auto; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 398.07px;" title="NS2" /></td></tr><tr><td class="tr-caption" style="text-align: center;">NS2 Simulation</td></tr></tbody></table><br /><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: left; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 312.33px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 398.07px;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><img alt="NS2" height="102" src="https://lh7-us.googleusercontent.com/QuHacy9xOpeZYhnLxgTnPXY3WlY4yMtxLnWGjkB6xPbDJpXNBchFMnZ-hozp9XafomV6HuSkE5ATWi7adt5IFWGO5_QjJzhvLITA5ol5sOeM90NU0JpY_u91piQxce3m_qE61hM8Zb9JqnBkWINWABc=w640-h102" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 98.67px; margin-left: auto; margin-right: auto; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 624px;" title="NS2" width="640" /></td></tr><tr><td class="tr-caption" style="text-align: center;">NS2 Output</td></tr></tbody></table></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: left; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: left; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 98.67px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 624px;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: left; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: "Arial"; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><table role="presentation" style="background-color: white; border-collapse: collapse; text-align: center; width: 100%;"><tbody><tr><td style="padding: 24px 0px 16px;"><table role="presentation" style="border-collapse: collapse; font-family: Roboto, Arial, Helvetica, sans-serif; hyphens: auto; margin: auto; max-width: 700px; min-width: 280px; overflow-wrap: break-word; width: 90%; word-break: break-word; word-wrap: break-word;"></table></td></tr></tbody></table><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-36894348796593050762023-12-29T15:31:00.003+05:302023-12-29T15:32:39.901+05:30Queuing in NS2 | NS2 Tutorial 5<p style="color: black; font-family: Arial; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: Times New Roman; font-size: x-large;"><b>Queuing in NS2 (RED Queue and SFQ)</b></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">HARDWARE / SOFTWARE REQ</span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">UIRED:</span></p><ul class="lst-kix_jki02u6yssg-0 start" style="margin: 0px; padding: 0px;"><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 38.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 38.2pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Network Simulator-2</span></li><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 38.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 38.2pt; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">Operating System – LINUX (</span><span style="font-family: "Times New Roman"; font-size: 12pt; font-style: italic; font-weight: 700;">UBUNTU</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">)</span></li></ul><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"><br /></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">THEORY:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Queue Management is defined as the algorithm that manages the length of the packet queues by dropping packets when necessary. From the point of packet dropping, Queue management can be classified into 2 types</span></p><ol class="lst-kix_axu8gkawwh1k-0 start" start="1" style="margin: 0px; padding: 0px;"><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Passive Queue Management: In Passive Queue Management the packet drop occurs only when the buffer gets full. Ex: Drop Tail.</span></li><li style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Active Queue Management: Active Queue Management employs preventive packet drops. It provides an implicit feedback mechanism to notify senders of the onset of congestion. Arriving packets are randomly dropped. Ex: RED. </span></li></ol><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Drop Tail:</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> In this packets are dropped from the tail of the queue. Once the buffer gets full, all arriving packets are discarded. Packets already in the queue are not affected.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 120.33px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 313.2px;"><img alt="" src="https://lh7-us.googleusercontent.com/Gf1t4XGotsGd6imANu_eu7b7U4gGpFUJFi9DFTZshfuil8DdLh-X3TJmeNmmfEw7kX2D5SYfyxARHcQz5M0V8yMrgXdcNIfDUWRvLKPDW902OF5vpEcLzLFn46Q9qnxzkx83FrLLiTQJ-KsO1cdJ6hU" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 120.33px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 313.2px;" title="" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Figure 2.1: Drop Tail mechanism</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">As shown in figure 2.1, the arriving packet gets dropped from the tail when the queue is filled.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Random Early Detection</span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">: </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">RED</span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"> accepts all packets until the queue reaches minth, after which it drops a packet with a linear probability distribution function. When the queue length reaches maxth all packets are dropped with probability of one.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 143.07px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 426.93px;"><img alt="" src="https://lh7-us.googleusercontent.com/dgUmbGzB4ZeVwPNoKYsZNMqNlUxEZK98nKsOnO0xvOZtabcirqKcPMw6VMB3k7dxC3eVY_emkQvYh43c7A50T9ZEMyVYs7CZRhxLFaPBBUXOMOBofnrL6ykWLv37HnIrqp6CYsZnD7TUV9sT0Vn6fj8" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 143.07px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 426.93px;" title="" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Figure 2.2: Random Early Detection</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">:</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 6pt; padding: 6pt 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Weighted random early detection (WRED)</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> </span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 6pt; padding: 6pt 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">It is a queuing discipline for a </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"><a href="https://www.google.com/url?q=https://en.wikipedia.org/wiki/Network_scheduler&sa=D&source=editors&ust=1703847274626734&usg=AOvVaw3HKMOztnj-CCKzh-t95H4m" style="color: inherit; text-decoration: inherit;">network scheduler</a></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"> suited for </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"><a href="https://www.google.com/url?q=https://en.wikipedia.org/wiki/Network_congestion_avoidance&sa=D&source=editors&ust=1703847274627063&usg=AOvVaw2GgPE52lyMAQN_HvBPj4yT" style="color: inherit; text-decoration: inherit;">congestion avoidance</a></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">. It is an extension to </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"><a href="https://www.google.com/url?q=https://en.wikipedia.org/wiki/Random_early_detection&sa=D&source=editors&ust=1703847274627272&usg=AOvVaw3BYHYWPbRBoDuNVF5xKAtL" style="color: inherit; text-decoration: inherit;">random early detection</a></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"> (RED) where a single queue may have several different sets of queue thresholds. Each threshold set is associated with a particular </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"><a href="https://www.google.com/url?q=https://en.wikipedia.org/wiki/Traffic_shaping%23Traffic_classification&sa=D&source=editors&ust=1703847274627480&usg=AOvVaw06Gwrez8mzPzAQ4m_7_bjF" style="color: inherit; text-decoration: inherit;">traffic class</a></span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">.</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 6pt; padding: 6pt 0px; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">For example, a queue may have lower thresholds for lower-priority packets. A queue buildup will cause the lower-priority packets to be dropped, hence protecting the higher-priority </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"><a href="https://www.google.com/url?q=https://en.wikipedia.org/wiki/Network_packet&sa=D&source=editors&ust=1703847274627741&usg=AOvVaw2zmMXlJcF6OKcgYt1FBNoi" style="color: inherit; text-decoration: inherit;">packets</a></span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"> in the same queue. In this way, </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"><a href="https://www.google.com/url?q=https://en.wikipedia.org/wiki/Quality_of_service&sa=D&source=editors&ust=1703847274627917&usg=AOvVaw38yqIKkMsEX3q4VdjG2R97" style="color: inherit; text-decoration: inherit;">quality of service</a></span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> prioritization is made possible for important packets from a pool of packets using the same buffer. </span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 6pt; padding: 6pt 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">It is more likely that standard traffic will be dropped instead of higher prioritized traffic.</span></p><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">WRED proceeds in this order when a packet arrives:</span></p><ul class="lst-kix_kzefi9tegqj1-0 start" style="margin: 0px; padding: 0px;"><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 37.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 37.2pt; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Calculation of the average queue size.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 37.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 37.2pt; orphans: 2; padding-bottom: 1.2pt; padding-left: 0pt; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 1.2pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The arriving packet is queued immediately if the average queue size is below the minimum queue threshold.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 37.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 37.2pt; orphans: 2; padding-bottom: 1.2pt; padding-left: 0pt; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 1.2pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Depending on the packet drop probability the packet is either dropped or queued if the average queue size is between the minimum and maximum queue threshold.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 37.2pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 37.2pt; orphans: 2; padding-bottom: 1.2pt; padding-left: 0pt; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 1.2pt 0pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The packet is automatically dropped if the average queue size is greater than the maximum threshold.</span></li></ul><h3 style="background-color: white; break-after: avoid; color: #434343; font-family: Arial; font-size: 14pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 0pt; padding-left: 0; padding-right: 0; padding-top: 18pt; padding: 18pt 0px 0pt; page-break-after: avoid; text-align: justify; widows: 2;"><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">Adaptive RED Queue Discipline:</span></h3><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: justify; widows: 2;"><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The motivation for Adaptive RED is the same as self-configuring RED. Self-configuring RED tries to keep the average queue size with minimum and maximum threshold values. But Sally Floyd says that why don’t keep the average queue size in a tight range just in the center of minimum and maximum threshold values. Also, Adaptive RED removes the kns and automatically sets them. Maximum drop probability is adapted based on the network availability, it is no longer a knob just like previous versions of RED. </span></p><h3 style="background-color: white; break-after: avoid; color: #434343; font-family: Arial; font-size: 14pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 0pt; padding-left: 0; padding-right: 0; padding-top: 18pt; padding: 18pt 0px 0pt; page-break-after: avoid; text-align: justify; widows: 2;"><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">Main contributions to Adaptive RED</span></h3><ul class="lst-kix_glxg2tmgi6v8-0 start" style="margin: 0px; padding: 0px;"><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 25.1pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 25.1pt; orphans: 2; padding-bottom: 0pt; padding-left: 3.2pt; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 0pt 3.2pt; text-align: justify; widows: 2;"><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">Automatic setting of minimum threshold (min</span><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-weight: 400; vertical-align: sub;">th</span><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">). It is set as a function of the link capacity (C) and target queue delay.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 25.1pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 25.1pt; orphans: 2; padding-bottom: 0pt; padding-left: 3.2pt; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 0pt 3.2pt; text-align: justify; widows: 2;"><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">Automatic setting of maximum threshold (max</span><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-weight: 400; vertical-align: sub;">th)</span><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">. It is set depending on the value of min</span><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-weight: 400; vertical-align: sub;">th</span><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">.</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 25.1pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 25.1pt; orphans: 2; padding-bottom: 0pt; padding-left: 3.2pt; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 0pt 3.2pt; text-align: justify; widows: 2;"><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Automatic setting of wq. It is set as a function of the link capacity (C).</span></li><li style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1; margin-bottom: 0; margin-left: 25.1pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 25.1pt; orphans: 2; padding-bottom: 0pt; padding-left: 3.2pt; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 0pt 3.2pt; text-align: justify; widows: 2;"><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">The adaptive setting of max</span><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-weight: 400; vertical-align: sub;">p.</span><span style="color: #273239; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> It is adapted according to the current average queue length.</span></li></ul><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">ALGORITHM:</span><span style="font-family: "Times New Roman"; font-weight: 700;"><br /></span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">1. Create a simulator object</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">2. Define different colors for different data flows</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">3. Open a nam and trace file (output files)</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">4. Create 8 nodes that form a network numbered from 0 to 7 for the RED queue mechanism and 6 nodes that form a network numbered from 0 to 5 for the Drop tail mechanism.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">5. Create duplex links between the nodes with a bandwidth of 100 Mbps.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">6. Create duplex links between n3 and n4 with a bandwidth of 2Mbps for the RED queue mechanism and create duplex links between n2 and n3 with a bandwidth of 1Mbps for the Drop tail.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">7. Set up TCP Connection between n0 and n5 and also set up UDP connection between n1 and n4 in case of Drop tail. In the case of the RED queue mechanism, set the TCP connection between n0 and n5 , the TCP connection between n2 and n7, and also set up the UDP connection between n1 and n6</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">8. Apply CBR Traffic over UDP, and FTP Traffic over TCP.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">9. Define the finish procedure then close the trace file, and execute the nam file.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">10. Schedule events and run the program</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 14pt; font-weight: 700;">PROGRAM:</span><span style="font-family: "Times New Roman"; font-size: 13pt; font-weight: 700;"><br /></span><span style="color: red; font-family: courier; font-size: 14pt; font-weight: 700;">(a) RED queue mechanism.</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><br /></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Simulation parameters setup</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="font-family: courier;"><span style="font-size: 14pt; font-weight: 400;">set val(stop) 10.0 </span><span style="color: #00b050; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">;# time of simulation end</span></span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Initialization </span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Create a ns simulator</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ns [new Simulator]</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Open the NS trace file</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tracefile [open queue_red.tr w]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns trace-all $tracefile</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Open the NAM trace file</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set namfile [open queue_red.nam w]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns namtrace-all $namfile</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Nodes Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Create 7 nodes</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n0 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n1 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n2 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n3 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n4 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n5 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n6 [$ns node]</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Links Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Create links between nodes</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n0 $n3 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n0 $n3 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n4 $n1 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n4 $n1 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n6 $n5 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n6 $n5 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n4 $n6 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n4 $n6 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n5 $n2 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n5 $n2 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n0 $n2 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n0 $n2 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n2 $n1 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n2 $n1 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n1 $n5 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n1 $n5 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n3 $n4 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n3 $n4 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n3 $n1 100.0Mb 10ms RED</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n3 $n1 50</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Give node position (for NAM)</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n0 $n3 orient right-up</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n4 $n1 orient left-down</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n6 $n5 orient left-down</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n4 $n6 orient right-down</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n5 $n2 orient left</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n0 $n2 orient right-down</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n2 $n1 orient right-up</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n1 $n5 orient right-down</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n3 $n4 orient right</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n3 $n1 orient right-down</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Agents Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tcp0 [new Agent/TCP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n0 $tcp0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set sink2 [new Agent/TCPSink]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n4 $sink2</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns connect $tcp0 $sink2</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$tcp0 set packetSize_ 1500</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a TCP/FullTcp/Tahoe connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tcp1 [new Agent/TCP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n2 $tcp1</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set sink3 [new Agent/TCPSink]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n6 $sink3</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns connect $tcp1 $sink3</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$tcp1 set packetSize_ 1500</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Applications Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a FTP Application over TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ftp0 [new Application/FTP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ftp0 attach-agent $tcp0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 1.0 "$ftp0 start"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 10.0 "$ftp0 stop"</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a FTP Application over TCP/FullTcp/Tahoe connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ftp1 [new Application/FTP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ftp1 attach-agent $tcp1</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 1.0 "$ftp1 start"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 10.0 "$ftp1 stop"</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Termination </span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Define a 'finish' procedure</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">proc finish {} {</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> global ns tracefile namfile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> $ns flush-trace</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> close $tracefile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> close $namfile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> exec nam queue_red.nam &</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> exit 0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">}</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $val(stop) "$ns nam-end-wireless $val(stop)"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $val(stop) "finish"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $val(stop) "puts \"done\" ; $ns halt"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns run</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="-webkit-text-decoration-skip: none; font-family: "Times New Roman"; font-size: 12pt; font-weight: 700; text-decoration-skip-ink: none; text-decoration: underline;">OUTPUT</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 284.67px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 340.07px;"><img alt="Queue" src="https://lh7-us.googleusercontent.com/AryxqdEPVLtTMtxHzaG4BqOmFpcYuJTfe5yoFZqca6D5v4ZrcKeqj5GuLbHg878008E55i9DeUaDK5vwVt6ZHwqBr_duOKKmA3bitH0mhI_uYvRFdQ4pgzD_HaM9QRqOVB4l90W--UYHI_wxpNjcCIY=s16000" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 284.67px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 340.07px;" title="Queue" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 14pt; font-weight: 700;">RED Queue in ns2</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: red; font-family: courier; font-size: 14pt; font-weight: 700;">SF queue mechanism</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># This script is created by NSG2 beta1</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># <http://wushoupong.googlepages.com/nsg></span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Simulation parameters setup</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="font-family: courier;"><span style="font-size: 14pt; font-weight: 400;">setval(stop) 10.5 </span><span style="color: #00b050; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">;# time of simulation end</span></span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Initialization </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Create a ns simulator</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ns [new Simulator]</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Open the NS trace file</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tracefile [open sfq.tr w]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns trace-all $tracefile</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Open the NAM trace file</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set namfile [open sfq.nam w]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns namtrace-all $namfile</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Nodes Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-weight: 400;">#Create 6 nodes</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n0 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n1 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n2 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n3 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n4 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set n5 [$ns node]</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Links Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Createlinks between nodes</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n0 $n2 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n0 $n2 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n3 $n2 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n3 $n2 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n1 $n2 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n1 $n2 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n3 $n4 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n3 $n4 50</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link $n3 $n5 100.0Mb 10ms SFQ</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns queue-limit $n3 $n5 50</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Give node position (for NAM)</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n0 $n2 orient right-down</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n3 $n2 orient left</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n1 $n2 orient right-up</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n3 $n4 orient right-up</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns duplex-link-op $n3 $n5 orient right-down</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Agents Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tcp0 [new Agent/TCP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n0 $tcp0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set sink3 [new Agent/TCPSink]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n5 $sink3</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns connect $tcp0 $sink3</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$tcp0 set packetSize_ 1500</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup a TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set tcp1 [new Agent/TCP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n4 $tcp1</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set sink2 [new Agent/TCPSink]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns attach-agent $n1 $sink2</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns connect $tcp1 $sink2</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$tcp1 set packetSize_ 1500</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Applications Definition </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup an FTP Application over a TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ftp0 [new Application/FTP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ftp0 attach-agent $tcp0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 1.0 "$ftp0 start"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 10.0 "$ftp0 stop"</span></p><p style="color: black; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Setup an FTP Application over a TCP connection</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">set ftp1 [new Application/FTP]</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ftp1 attach-agent $tcp1</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 1.0 "$ftp1 start"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at 10.0 "$ftp1 stop"</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"># Termination </span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#===================================</span></p><p style="color: black; font-size: 11pt; line-height: 1; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: #00b050; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">#Define a 'finish' procedure</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">proc finish {} {</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">global ns tracefilenamfile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> $ns flush-trace</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">close $tracefile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">close $namfile</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">exec nam sfq.nam &</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">exit 0</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">}</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $val(stop) "$ns nam-end-wireless $val(stop)"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $val(stop) "finish"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns at $val(stop) "puts \"done\" ; $ns halt"</span></p><p style="color: black; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: courier; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">$ns run</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="color: black; font-family: "Times New Roman"; font-size: 14pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 14pt; font-weight: 700;">NAM OUTPUT</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 336.73px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 411.93px;"><img alt="nam" src="https://lh7-us.googleusercontent.com/ijzvgjQPx6wDH0mKsrONtLHVaOvROjsmPo_39YqszUtrONW_1V_-I1cCwfc52IcMPE44A3Boi8IG5mSVAs1BuCIzJh_VqT5RVbc0rrVmosJvNR-yyDH91xxnsp3plWchHH6bEFaWwRH9oOsCirllGkk=s16000" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 336.73px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 411.93px;" title="nam" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: center; widows: 2;"><span style="-webkit-text-decoration-skip: none; color: black; font-family: "Times New Roman"; font-size: 14pt; font-style: normal; font-weight: 700; text-decoration-skip-ink: none; text-decoration: underline; vertical-align: baseline;"></span></p><p id="h.gjdgxs" style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding: 0px; text-align: left; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 14pt; font-weight: 700;">AWK OUTPUT</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; orphans: 2; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: left; widows: 2;"><span style="-webkit-transform: rotate(0.00rad) translateZ(0px); border: 0px solid rgb(0, 0, 0); display: inline-block; height: 109px; margin: 0px; overflow: hidden; transform: rotate(0rad) translateZ(0px); width: 622.13px;"><img height="112" src="https://lh7-us.googleusercontent.com/2yk6_QQaiL2mm3nWqD8BANMPsLcNZqDAfDRJVxU0BVzAQnZE4QNV3SUxtfa_VLMVZNVQoTxiBm-NSPFgfwpzB1veeCMHNuL22ktFOc9mO9kBNsWxvPSGTPi0ZkWkkpDaT-qgGYl59MzsXcpxo9GsoA4=w640-h112" style="-webkit-transform: rotate(0.00rad) translateZ(0px); height: 109px; margin-left: 0px; margin-top: 0px; transform: rotate(0rad) translateZ(0px); width: 622.13px;" width="640" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; orphans: 2; padding-bottom: 6pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 6pt; text-align: center; widows: 2;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Nam and AWK output files</span></p><br /><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-8216886622324890982023-11-10T11:32:00.002+05:302023-11-10T11:32:08.543+05:30Telnet and FTP for a wired network | NS2 Tutorial 4<div dir="ltr"><div class="gmail_default" style="font-family: monospace, monospace;"><span id="gmail-docs-internal-guid-43804197-7fff-de01-6e7e-65867d1d3660" style="font-size: medium;"><h1 style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt; text-align: left;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">TELNET and FTP for a Wired Network</span></h1><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"><span style="border: none; display: inline-block; height: 235px; overflow: hidden; width: 384px;"><img class="hoverZoomLink" height="235" src="https://lh7-us.googleusercontent.com/pGZyx5zU-q31JW7ZH35K43AwYizUIsyVHYYNdX5oouJ1hs2EYo2MKkfV2OMTOeStwZSk4yOBnOgdj2JRqpRdfptnYtLy8-svnSTUJ9k7XrBio1Nt0u9dSsG_vlXiYLlwlqTMfATNTnixrytYYfoygLin-wnbxTgXxJNX1vd_SAhPEZVTL8KWbTw4QajguA" style="margin-left: 0px; margin-top: 0px;" width="384" /></span></span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">In the above network, Node 0 to Node 5 is enabled with Telnet Application, and Node 4 to Node 1 is enabled with FTP Application. </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">Both FTP and TElnet are application layer protocols use TCP as the transport Layer. </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><br /></p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">Requisites:</p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">OS: Ubuntu 22.04</p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">NS Version: 2.35</p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">Results: Throughput with the help of AWK script</p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">Animation: NAM</p><p dir="ltr" style="line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;">Graphs: xgraph or gnuplot</p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">PROGRAM</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"># Simulation parameters setup</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set val(stop) 10.5 </span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"> ;# time of simulation end</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"># Initialization </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Create a ns simulator</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set ns [new Simulator]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">#Open the NS trace file</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set tracefile [open <a href="http://telnet.tr">telnet.tr</a> w]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns trace-all $tracefile</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Open the NAM trace file</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set namfile [open telnet.nam w]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns namtrace-all $namfile</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"># Nodes Definition </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Create 6 nodes</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set n0 [$ns node]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set n1 [$ns node]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set n2 [$ns node]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set n3 [$ns node]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set n4 [$ns node]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set n5 [$ns node]</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"># Links Definition </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Create links between nodes</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link $n0 $n2 100.0Mb 10ms RED</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns queue-limit $n0 $n2 50</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link $n3 $n2 100.0Mb 10ms RED</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns queue-limit $n3 $n2 50</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link $n1 $n2 100.0Mb 10ms RED</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns queue-limit $n1 $n2 50</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link $n3 $n4 100.0Mb 10ms RED</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns queue-limit $n3 $n4 50</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link $n3 $n5 100.0Mb 10ms RED</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns queue-limit $n3 $n5 50</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Give node position (for NAM)</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link-op $n0 $n2 orient right-down</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link-op $n3 $n2 orient left</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link-op $n1 $n2 orient right-up</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link-op $n3 $n4 orient right-up</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns duplex-link-op $n3 $n5 orient right-down</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"># Agents Definition </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Setup a TCP connection</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set tcp0 [new Agent/TCP]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns attach-agent $n0 $tcp0</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set sink3 [new Agent/TCPSink]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns attach-agent $n5 $sink3</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns connect $tcp0 $sink3</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$tcp0 set packetSize_ 1500</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Setup a TCP connection</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set tcp1 [new Agent/TCP]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns attach-agent $n4 $tcp1</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set sink2 [new Agent/TCPSink]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns attach-agent $n1 $sink2</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns connect $tcp1 $sink2</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$tcp1 set packetSize_ 1500</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"># Applications Definition </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Setup a TELNET Application over TCP connection</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set telnet0 [new Application/Telnet]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$telnet0 attach-agent $tcp0</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns at 1.0 "$telnet0 start"</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns at 10.0 "$telnet0 stop"</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$telnet0 set interval_ 0.002</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$telnet0 set type_ Telnet</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Setup an FTP Application over a TCP connection</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">set ftp1 [new Application/FTP]</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ftp1 attach-agent $tcp1</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns at 1.0 "$ftp1 start"</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns at 10.0 "$ftp1 stop"</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"># Termination </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#===================================</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">#Define a 'finish' procedure</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">proc finish {} {</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"> global ns tracefile namfile</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"> $ns flush-trace</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"> close $tracefile</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"> close $namfile</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"> exec nam telnet.nam &</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"> exit 0</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">}</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns at $val(stop) "$ns nam-end-wireless $val(stop)"</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns at $val(stop) "finish"</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns at $val(stop) "puts \"done\" ; $ns halt"</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ns run</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">When you run the above file using the command </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">$ ns telnet.tcl </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">The outputs generated are telnet.nam and <a href="http://telnet.tr">telnet.tr</a> </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">The packet transmission is shown like this in the animation window below</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 12pt; margin-top: 12pt; text-align: justify;"><span style="background-color: transparent; color: black; font-family: "Times New Roman",serif; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">Output NAM File</span></p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="color: #351c75; margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><img class="hoverZoomLink" height="215" src="https://lh7-us.googleusercontent.com/MjIUGbI4JvY1jbQDcuM8-SgdcTmAp7vn0vC1CwK6ynAAqPDTbXTbEw-vlXde723NBQap3hceHzx1zBvLQDoyKR4CPX8jWeqyL8b1W31f1WDVbvjNpWq0r_vV_5ofBsup9bktcUvo0W_KA9ogHwNsFBm0tD13_9M1Jew8--uXVY1ggROQ__k5vbbjZGpoQg" style="margin-left: auto; margin-right: auto; margin-top: 0px;" width="315" /></td></tr><tr><td class="tr-caption" style="text-align: center;">Nam output</td></tr></tbody></table><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"><span style="border: none; display: inline-block; height: 215px; overflow: hidden; width: 315px;"></span></span><span style="color: black; font-family: "Times New Roman", serif; font-weight: 700; text-align: justify;">Output Trace File</span></p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="color: #351c75; margin-left: auto; margin-right: auto; text-align: center;"><tbody><tr><td style="text-align: center;"><img class="hoverZoomLink" height="500" src="https://lh7-us.googleusercontent.com/PXylZsDWoWyobUGv6vYx9_L2almVii39F5Xi07sJC7RuLj2Ho_DLlPM274VZylqnLQSHGBqVq4ywtfKDj9jHAcOdq9nFqsUTA5dRoE5Q0i06GXzwMNJk_wWHg53WtepMN4CWzDvOkVpaea7f71hQLtnkPoIC1CEMoobUxbzjhbWg1Fi93Ws55XPJ0MiztA=w640-h500" style="margin-left: auto; margin-right: auto; margin-top: 0px;" width="640" /></td></tr><tr><td class="tr-caption" style="text-align: center;">Trace</td></tr></tbody></table><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"><span style="border: none; display: inline-block; height: 416px; overflow: hidden; width: 532px;"></span></span><span style="color: black;">To get the throughput of the above file in bits per second, here is the awk script: </span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">Save the following code in a file called </span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">throughput.awk </span><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">and store in the same place where the tcl code is also stored. </span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">BEGIN {</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">recv = 0</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">currTime = prevTime = 0</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">tic = 0.1</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">}</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">{</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"># Trace line format: normal</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">if ($2 != "-t") {</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">event = $1</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">time = $2</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">if (event == "+" || event == "-") node_id = $3</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">if (event == "r" || event == "d") node_id = $4</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">flow_id = $8</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">pkt_id = $12</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">pkt_size = $6</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">flow_t = $5</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">level = "AGT"</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">}</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"># Trace line format: new</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">if ($2 == "-t") {</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">event = $1</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">time = $3</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">node_id = $5</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">flow_id = $39</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">pkt_id = $41</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">pkt_size = $37</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">flow_t = $45</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">level = $19</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">}</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"># Init prevTime to the first packet recv time</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">if(prevTime == 0)</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">prevTime = time</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"># Calculate the total received packets' size</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">if (level == "AGT" && event == "r" ) {</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"># Store received packet's size</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">recv += pkt_size</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"># This 'if' is introduced to obtain clearer</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"># Plots from the output of this script</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">currTime += (time - prevTime)</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">if (currTime >= tic) {</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">printf("%15g %18g\n",time,(recv/currTime)*(8/1000))</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">recv = 0</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">currTime = 0</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">}</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">prevTime = time</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">}</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">}</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">END {</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;"><span class="gmail-Apple-tab-span" style="text-wrap: nowrap;"> </span></span><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">printf("\n\n")</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">}</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">The above file can be run using the command:</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span style="background-color: transparent; color: black; font-family: "Courier New",monospace; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: 700; vertical-align: baseline;">$ gawk -f throughput.awk <a href="http://out.tr">out.tr</a></span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">The above command will print the following which informs the throughput of using Telnet and FTP</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">AWK OUTPUT</span></p><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"><span style="border: none; display: inline-block; height: 620px; overflow: hidden; width: 554px;"><img class="hoverZoomLink" height="640" src="https://lh7-us.googleusercontent.com/qWnUZgnMGr_5vwGbAYzCIuoTR3ImIoyXtYTfm7H2Hkwrp5ZsQ7ZaBAtEyyGzxsVVZMxoiM11mpv7Wib8lA9XZYv3QbXms9mJCW1f4_unb7-2lI7JHF1Q4_eqMVq5SxiWLFGg-HWCniFav6qPrKNGzJDhNnJ3JT_5HEgiFTKRniLEdBSVrBOaDCJadLk-rg=w572-h640" style="margin-left: 0px; margin-top: 0px;" width="572" /></span></span><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"> </span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">The plotting of <a href="http://out.tr">out.tr</a> is looking like the following graph:</span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">$ xgraph <a href="http://out.tr">out.tr</a> </span></p><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="color: #351c75; margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><img alt="Xgraph" class="hoverZoomLink" height="640" src="https://lh7-us.googleusercontent.com/f45iveZ6RB7Ast-_1dvGuqPzSkwNfWiwMmfvWhNkuD825YQZITbKhOCwWWKgdv8zKxhPW6CrZ2o49b1f0OLNJ4aFhKdkinughWoeb8NnvrYPw96S4Ja3hf3SmA35t03j6wKcfn2f3iGVyIyLqinw5vef4IqDjQo4qnimIHGyaAnNqXmo3i3iurQ5MTvZXQ=w616-h640" style="margin-left: auto; margin-right: auto; margin-top: 0px;" title="Xgraph" width="616" /></td></tr><tr><td class="tr-caption" style="text-align: center;">Xgraph</td></tr></tbody></table><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;"><span style="border: none; display: inline-block; height: 437px; overflow: hidden; width: 420px;"></span></span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">Gnuplot Output will be like this </span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">$ gnuplot </span></p><br /><p dir="ltr" style="color: #351c75; line-height: 1.38; margin-bottom: 0pt; margin-top: 0pt;"><span face="Arial,sans-serif" style="background-color: transparent; color: black; font-variant-alternates: normal; font-variant-east-asian: normal; font-variant-numeric: normal; vertical-align: baseline;">gnuplot> plot "<a href="http://out.tr">out.tr</a>" using 1:2 with linespoints title "Throughput"</span></p><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="color: #351c75; margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><img alt="Gnuplot" class="hoverZoomLink" height="314" src="https://lh7-us.googleusercontent.com/2XZKi6K7DDHipoueXWX3tCkzOtEEK3qfBwA6L4xXgWJUOGAko_vUFJvadDduWAxarrFfsCfalsCgHMI5aM5ypLYhPR9wKyFnGokXZCIN2fM_u5o1OkOB96FX29JZDaD_LO3373dRcxJWxFLLFCURNKd2TqIXdaPsB5BVLS2V2ZHaECs7dNPPnxZ38_crdA=w640-h314" style="margin-left: auto; margin-right: auto; margin-top: 0px;" title="Gnuplot" width="640" /></td></tr><tr><td class="tr-caption" style="text-align: center;">Gnuplot</td></tr></tbody></table><br /></span><br class="gmail-Apple-interchange-newline" /></div></div> <div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-74106974737931749782023-10-29T23:06:00.009+05:302023-10-29T23:06:55.224+05:30AWK and NS2 Tracefile | NS2 Tutorial 3<table role="presentation" style="background-color: white; border-collapse: collapse; text-align: center; width: 100%;"><tbody><tr><td style="padding: 24px 0px 16px;"><table role="presentation" style="border-collapse: collapse; font-family: Roboto, Arial, Helvetica, sans-serif; hyphens: auto; margin: auto; min-width: 280px; overflow-wrap: break-word; text-align: left; width: 90%; word-break: break-word; word-wrap: break-word;"><tbody><tr><td style="padding: 0px;"><table role="presentation" style="border-collapse: separate; border-radius: 8px; border-spacing: 0px; border: 1px solid rgb(218, 220, 224); table-layout: fixed; width: 100%;"><tbody><tr><td dir="ltr" style="padding: 4.5%;"><div style="padding: 10px 0px;"><p style="color: black; font-family: Arial; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: x-large; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">AWK</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">Awk is abbreviated from the names of the developers – </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">Aho, Weinberger, and Kernighan</span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Awk is a scripting language used for manipulating data and generating reports. The awk command programming language requires no compiling and allows the user to use variables, numeric functions, string functions, and logical operators.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">AWK is one of the most prominent text-processing utilities on GNU/Linux. It is very powerful and uses a simple programming language.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Awk is a utility that enables a programmer to write tiny but effective programs in the form of statements that define text patterns that are to be searched for in each line of a document and the action that is to be taken when a match is found within a line.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">1. AWK Operations:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">(a) Scans a file line by line</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">(b) Splits each input line into fields</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">(c) Compares input line/fields to pattern</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">(d) Performs action(s) on matched lines</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">2. AWK Useful For:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">(a) Transform data files</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 36pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 36pt; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">(b) Produce formatted reports</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: red; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Syntax:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; text-indent: 36pt;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">$ </span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">awk options 'selection _criteria {action }' input-file > output-file</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; text-indent: 36pt;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">Or</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify; text-indent: 36pt;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">$ gawk options 'selection _criteria {action }' input-file > output-file</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: red; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Options: </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">-f program-file: Reads the AWK program source from the file</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Awk is not just a command, but a programming language too. In other words, awk utility is a pattern scanning and processing language. It searches one or more files to see if they contain lines that match specified patterns and then performs associated actions, such as writing the line to the standard output or incrementing a counter each time it finds a match. </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">Variables </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Awk allows the user to use variables of their choice. You can now print a serial number, using the variable count, and apply it to those directors drawing a salary exceeding 6700:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding: 0px; text-align: justify;"><span style="font-family: "Courier New"; font-size: 12pt; font-weight: 400;">$ awk –F "|" '$3 == "director" && $6 > 6700 {<br />kount = kount+1<br />printf " %3f %20s %-12s %d\n", kount,$2,$3,$6 }' empn.lst</span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;"><br /></span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;"><br />THE –f OPTION: STORING awk PROGRAMS IN A FILE</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">You should hold large awk programs in separate files and provide them with the awk extension for easier identification. Let's first store the previous program in the file<br />empfile.awk:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Courier New"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">$ cat empfile.awk</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">Observe that this time we haven't used quotes to enclose the awk program. You can<br />now use awk with the –f </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-style: italic; font-weight: 400;">filename </span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">option to obtain the same output:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Courier New"; font-size: 13pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">$ gawk –F "|" –f empfile.awk empn.lst</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">THE BEGIN AND END SECTIONS</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Awk statements are usually applied to all lines selected by the address, and if there are no addresses, then they are applied to every line of input. But, if you have to print something before processing the first line, for example, a heading, then the BEGIN section can be used gainfully. Similarly, the end section useful in printing some totals after processing is over.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;">The BEGIN and END sections are optional and take the form<br /></span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">BEGIN {action}</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">END {action}</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">These two sections, when present, are delimited by the body of the awk program. You<br />can use them to print a suitable heading at the beginning and the average salary at the end.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">BUILT-IN VARIABLES</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Awk has several built-in variables. They are all assigned automatically, though it is also possible for a user to reassign some of them. You have already used NR, which signifies the record number of the current line. We'll now have a brief look at some of the other variables.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: italic; font-weight: 700; text-decoration: none; vertical-align: baseline;">The FS Variable: </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">as stated elsewhere, awk uses a contiguous string of spaces as the default field delimiter. FS redefines this field separator, which in the sample database happens to be the |. When used at all, it must occur in the BEGIN section so that the body of the program knows its value before it starts processing:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">BEGIN {FS="|"}</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">This is an alternative to the –F option which does the same thing. </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-style: italic; font-weight: 400;">The OFS Variable: </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">when you used the print statement with comma-separated arguments, each argument was separated from the other by a space. This is awk's default output field separator, and can reassigned using the variable OFS in the BEGIN section:<br /></span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">BEGIN { OFS="~" }</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 400;">When you reassign this variable with a ~ (tilde), awk will use this character for delimiting the print arguments. This is a useful variable for creating lines with delimited fields. </span><span style="font-family: "Times New Roman"; font-size: 12pt; font-style: italic; font-weight: 400;">The NF variable: </span><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">NF comes in quite handy for cleaning up a database of lines that don't contain the right number of fields. By using it on a file, say emp.lst, you can locate those lines not having 6 fields, and which have crept in due to faulty data entry: </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.5; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="font-family: "Courier New"; font-size: 12pt; font-weight: 700;">$awk 'BEGIN {FS = "|"}<br />NF! =6 {<br />Print "Record No ", NR, "has", "fields"}' empx.lst</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 14pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">Output NS2 Trace file:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">The Trace file contains 12 columns: Event type, Event time, From Node To Node, Packet Type, Packet Size, Flags (indicated by --------), Flow ID, Source address, Destination Address, Sequence ID, Packet ID</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;"> </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Structure of Trace Files</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">When tracing into an output ASCII file, the trace is organized in 12 fields as follows in fig shown below,</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="font-family: "Times New Roman"; font-size: 12pt; font-weight: 700;"> </span><span style="border: 0px solid rgb(0, 0, 0); display: inline-block; height: 65.58px; margin: 0px; overflow: hidden; width: 567.1px;"><img alt="" src="https://lh7-us.googleusercontent.com/XUX0tAufs_FcPnLdtXHXlYNyF-4nRhKaTXoFu3UrocIorF2WwXeWN9I1xlsu7rnDGzi7-tP4exUkn204twv27oG78lyyceuhiMHiBwgYiUcLl4oJBhHVtIw--dISUxmFO6Vng_fNzWbYmkEX1XTD8mA" style="height: 65.58px; margin-left: 0px; margin-top: 0px; width: 567.1px;" title="" /></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">The meaning of the fields is:</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">1. The first field is the event type. It is given by one of four possible symbols r, +, -, d which correspond respectively to receive (at the output of the link), enqueued, dequeued, and dropped.<br />2. The second field gives the time at which the event occurs.<br />3. Gives the input node of the link at which the event occurs.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">4. Gives the output node of the link at which the event occurs.<br />5. Gives the packet type (eg CBR or TCP)<br />6. Gives the packet size<br />7. Some flags<br />8. This is the flow-id (fid) of IPv6 that a user can set for each flow at the input OTcl script<br />one can further use this field for analysis purposes; it is also used when specifying a stream<br />color for the NAM display.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">9. This is the source address given in the form of "node. port".<br />10. This is the destination address, given in the same form.<br />11. This is the network layer protocol's packet sequence number. Even though UDP<br />implementations in a real network do not use sequence numbers, ns keeps track of UDP<br />packet sequence number for analysis purposes</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">12. The last field shows the unique id of the packet.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Arial"; font-size: 16pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Arial"; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p></div></td></tr></tbody></table><table role="presentation" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="padding: 24px 4.5%;"><table dir="ltr" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="color: #5f6368; font-family: Roboto, Arial, Helvetica, sans-serif; font-size: 12px; letter-spacing: 0.3px; line-height: 16px; min-height: 40px; padding: 0px; width: 100%;">Google LLC, 1600 Amphitheatre Parkway, Mountain View, CA 94043, USA<br /> You have received this email because <a href="mailto:acadprj@gmail.com" style="color: inherit; text-decoration: none;">acadprj@gmail.com</a> shared a document with you from Google Docs.</td><td style="min-width: 96px; padding-left: 20px; padding: 0px 0px 0px 20px;"><a href="https://www.google.com/" style="text-decoration: none;" target="_blank"><img alt="Google" height="40" src="https://www.gstatic.com/images/branding/googlelogo/2x/googlelogo_grey_tm_color_96x40dp.png" style="color: #5f6368; font-size: 16px; font-weight: 500;" width="96" /></a></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com1tag:blogger.com,1999:blog-8826608353769320919.post-73725099682356231842023-10-29T22:56:00.000+05:302023-10-29T22:56:41.175+05:30Installation of NS2 in Ubuntu 22.04 | NS2 Tutorial 2<h2 style="text-align: left;"><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-size: x-large;">NS-2.35 installation in Ubuntu 22.04 </span></span></h2><span class="style-scope yt-formatted-string" dir="auto" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><div style="font-family: Roboto, Arial, sans-serif;"><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">This post shows how to install ns-2.35 in Ubuntu 22.04 Operating System</span></div><div style="font-family: Roboto, Arial, sans-serif;"><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><br /></span></div><div style="font-family: Roboto, Arial, sans-serif;">Since ns-2.35 is too old, it needs the following packages</div><div style="font-family: Roboto, Arial, sans-serif;">gcc-4.8</div><div style="font-family: Roboto, Arial, sans-serif;">g++-4.8</div><div style="font-family: Roboto, Arial, sans-serif;">gawk</div><div style="font-family: Roboto, Arial, sans-serif;"><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">and some more libraries</span></div><div style="font-family: Roboto, Arial, sans-serif;"><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><br /></span></div><div style="font-family: Roboto, Arial, sans-serif;">Follow the video for more instructions</div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/tH0yrJdovWM" width="320" youtube-src-id="tH0yrJdovWM"></iframe></div><br /><div style="font-family: Roboto, Arial, sans-serif;"><br /></div><div style="font-family: Roboto, Arial, sans-serif;"><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">So, here are the steps to install this software:</span></div><div style="font-family: Roboto, Arial, sans-serif;"><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><h3 style="text-align: left;"><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; color: #0f0f0f; margin: 0px; padding: 0px;">To download and extract the ns2 software </span></h3><div>Download the software from the following link</div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; color: #0f0f0f; margin: 0px; padding: 0px;"><a href="http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download">http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.35/ns-allinone-2.35.tar.gz/download</a></span></div><div><br /></div><div>Extract it to home folder and in my case its /home/pradeepkumar (I recommend to install it under your home folder)</div><div><br /></div><div>$ tar zxvf ns-allinone-2.35.tar.gz </div><div>or Right click over the file and click extract here and select the home folder.</div><div><br /></div></span></div><div><span style="font-family: courier;"><b>$ sudo apt update</b></span></div><span style="font-family: courier;"><b>$ sudo apt install build-essential autoconf automake libxmu-dev gawk
</b></span></span><h3 style="text-align: left;"><span style="font-size: large;"><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; margin: 0px; padding: 0px; white-space: pre-wrap;">To install gcc-4.8 and g++-4.8</span></span></h3><div><span class="style-scope yt-formatted-string" dir="auto" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ sudo gedit /etc/apt/sources.list</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">
make an entry in the above file</span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">
</span><span class="style-scope yt-formatted-string" dir="auto" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-family: courier; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">deb </span><a class="yt-simple-endpoint style-scope yt-formatted-string" dir="auto" href="https://www.youtube.com/redirect?event=video_description&redir_token=QUFFLUhqbUNReFpYUk1xVGdoSGZodGZBeXJMUGw5OE8xUXxBQ3Jtc0tuY0pMVUFOY2tLeXNkTzFMUFlGNmt0SHF2MEVfVU85WHB6alBITlBMVThPdEotOE9oMVFTMl9YR2dJZ2ZRdG9GOXh1T1FTRHRQVjV4Y0xjQTJlbmVXaUd2RkRHWktqdG5YQkdZcDJSbjM4RERQQVhfMA&q=http%3A%2F%2Fin.archive.ubuntu.com%2Fubuntu%2F&v=tH0yrJdovWM" rel="nofollow" spellcheck="false" style="-webkit-text-decoration: var(--yt-endpoint-text-regular-decoration,none); color: var(--yt-endpoint-visited-color,var(--yt-spec-call-to-action)); cursor: pointer; display: var(--yt-endpoint-display,inline-block); font-family: courier; font-size: 14px; text-decoration: var(--yt-endpoint-text-regular-decoration,none); white-space: pre-wrap; word-break: var(--yt-endpoint-word-break,none); word-wrap: var(--yt-endpoint-word-wrap,none);" target="_blank">http://in.archive.ubuntu.com/ubuntu/</a><span class="style-scope yt-formatted-string" dir="auto" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"> bionic main universe
$ sudo apt update</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">
</span></div><div><br /></div><div><span face="Roboto, Arial, sans-serif" style="color: #0f0f0f;"><span style="caret-color: rgb(15, 15, 15); font-size: 14px; white-space: pre-wrap;">Since, it's ubuntu 22.04, you may get an error called GPG Error with a code like this "</span></span><span face="Roboto, Arial, sans-serif" style="caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; white-space: pre-wrap;">3B4FE6ACC0B21F32"</span></div><div><span face="Roboto, Arial, sans-serif" style="color: #0f0f0f;"><span style="caret-color: rgb(15, 15, 15); font-size: 14px; white-space: pre-wrap;">In case you get the GPG error, </span></span><span face="Roboto, Arial, sans-serif" style="caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; white-space: pre-wrap;">include the following command</span></div><div><span face="Roboto, Arial, sans-serif" style="caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; white-space: pre-wrap;"><br /></span></div><div><span class="style-scope yt-formatted-string" dir="auto" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
$ sudo apt update
$ sudo apt install gcc-4.8 g++-4.8
</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">
Make the changes in the following files</span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">
</span><span class="style-scope yt-formatted-string" dir="auto" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">@CC@ to be replaced with gcc-4.8
@CPP@ to be replaced with g++-4.8</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">
</span><span class="style-scope yt-formatted-string" dir="auto" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">ns-allinone-2.35/Makefile.in
/home/pradeepkumar/ns-allinone-2.35/otcl-1.14/Makefile.in
nam-1.15/Makefile.in
xgraph-12.2/Makefile.in
</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">
In all the above places, change @CC@ to gcc-4.8
and @CPP@ @CXX@ to g++-4.8
Open the file
</span><span class="style-scope yt-formatted-string" dir="auto" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">ns-2.35/linkstate/ls.h
</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">in line number 137, change the line erase to this-erase
Once the installation is over, Set the PATH and LD_LIBRARY_PATH information in the file located at
<span style="font-family: courier;">/home/pradeepkumar/.bashrc
</span>
</span><span class="style-scope yt-formatted-string" dir="auto" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">export PATH=$PATH:/home/pradeepkumar/ns-allinone-2.35/bin:/home/pradeepkumar/ns-allinone-2.35/tcl8.5.10/unix:/home/pradeepkumar/ns-allinone-2.35/tk8.5.10/unix
export LD_LIBRARY_PATH=/home/pradeepkumar/ns-allinone-2.35/otcl-1.14:/home/pradeepkumar/ns-allinone-2.35/lib</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">
<br /></span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;"><b><span style="color: red;">You can change /home/pradeepkumar to your home folder name. </span></b></span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">
$ns
$nam
$ xgraph </span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">1 2</span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">3 4</span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">5 6</span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">6 7</span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">8 9</span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">10 11</span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="border: 0px; caret-color: rgb(15, 15, 15); color: #0f0f0f; font-size: 14px; margin: 0px; padding: 0px; white-space: pre-wrap;">and press Control D (You can get a good graph) and that's it...
</span></div><div><br /></div><div><br /></div><div><span face="Roboto, Arial, sans-serif" style="color: #0f0f0f;"><span style="caret-color: rgb(15, 15, 15); font-size: 14px; white-space: pre-wrap;">For video lectures of this kind, subscribe to my Channel <a href="https://www.youtube.com/tspradeepkumar">https://www.youtube.com/tspradeepkumar</a> </span></span></div><div><span face="Roboto, Arial, sans-serif" style="color: #0f0f0f;"><span style="caret-color: rgb(15, 15, 15); font-size: 14px; white-space: pre-wrap;"><br /></span></span></div><div><ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-78295588046926449582023-10-29T22:48:00.013+05:302023-10-29T22:49:34.279+05:30Introduction to Network Simulator 2 | NS2 Tutorial 1 <table role="presentation" style="background-color: white; border-collapse: collapse; text-align: center; width: 100%;"><tbody><tr><td style="padding: 24px 0px 16px;"><table role="presentation" style="border-collapse: collapse; font-family: Roboto, Arial, Helvetica, sans-serif; hyphens: auto; margin: auto; min-width: 280px; overflow-wrap: break-word; text-align: left; width: 90%; word-break: break-word; word-wrap: break-word;"><tbody><tr><td style="padding: 0px;"><table role="presentation" style="border-collapse: separate; border-radius: 8px; border-spacing: 0px; border: 1px solid rgb(218, 220, 224); table-layout: fixed; width: 100%;"><tbody><tr><td dir="ltr" style="padding: 4.5%;"><div style="color: #3c4043; font-family: "Google Sans", Roboto, Arial, Helvetica, sans-serif; font-style: normal; line-height: 36px; margin-bottom: 32px;"><span style="color: #666666; font-family: Arial; font-size: x-large; text-align: justify;">Introduction to Network Simulator 2</span></div><div style="padding: 10px 0px;"><p style="background-color: white; color: black; font-family: Arial; font-size: 11pt; line-height: 1.29545; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">NS2 stands for Network Simulator Version 2. It is an open-source event-driven simulator designed specifically for research in computer communication networks.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify; text-indent: 36pt;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Network Simulator (Version 2), is simply an event-driven simulation tool that has proved useful in studying the dynamic nature of communication networks. Simulation of wired as well as wireless network functions and protocols (e.g., routing algorithms, TCP, UDP) can be done using NS2. In general, NS2 provides users with a way of specifying such network protocols and simulating their corresponding behaviors. Due to its flexibility and modular nature, NS2 has gained constant popularity in the networking research community since its birth in 1989. Ever since, several revolutions and revisions have marked the growing maturity of the tool, thanks to substantial contributions from the players in the field. Among these are the University of California and Cornell University which developed the REAL network simulator, the foundation on which NS is based. Since 1995 the Defense Advanced Research Projects Agency (DARPA) supported the development of NS through the Virtual Inter Network Testbed (VINT) project. Currently, the National Science Foundation (NSF) has joined the ride in development. Last but not least, the group of Researchers and developers in the community are constantly working to keep NS2 strong and versatile</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: left;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: left;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">Features of NS2</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">1. It is a discrete event simulator for networking research.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">2. It provides substantial support to simulate a bunch of protocols like TCP, FTP, UDP, HTTP, and DSR.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">3. It is primarily Unix-based.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">4. Uses TCL as its scripting language.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">5. Otcl: Object-oriented support</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> 6. Tclcl: C++ and otcl linkage</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">7. Discrete event scheduler</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><div class="separator" style="clear: both; text-align: center;"><span style="border: 0px solid rgb(0, 0, 0); display: inline-block; height: 158px; margin-left: 1em; margin-right: 1em; margin-top: 0px; overflow: hidden; width: 328px;"><img alt="" src="https://lh7-us.googleusercontent.com/hIDdhSp42salzBJgycItinf_PmrCeHbqaaJcM-gtqBAdukm9WntjwZOYFbMWsQUx7WnHyyJzU4bvKySJHyhPHPNAJe3y-qgwxI-eXGb_CFUOB4DCMbGTa-3tqrgYIyJzI5b_s7uIjBLQr7mjcwtvy6g" style="height: 158px; margin-left: 0px; margin-top: 0px; width: 328px;" title="" />The basic</span></div><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin-bottom: 0; margin-left: 108pt; margin-right: 0; margin-top: 0; margin: 0px 0px 0px 108pt; padding: 0px; text-align: left; text-indent: 36pt;"><span style="color: black; font-family: "Arial"; font-size: 12pt; font-style: normal; font-weight: 700; text-decoration: none; vertical-align: baseline;">The basic architecture of NS2</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify; text-indent: 36pt;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"> </span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify; text-indent: 36pt;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">Figure shows the basic architecture of NS2. The NS2 provides users with executable command ns which takes on input argument, the name of a Tcl simulation scripting file. Users are feeding the name of a Tcl simulation script (which sets up a simulation) as an input argument of an NS2 executable command ns.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify; text-indent: 36pt;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;">In most cases, a simulation trace file is created and is used to plot graphs and/or to create animation. NS2 consists of two key languages: C++ and Object-oriented Tool Command Language (OTcl). While C++ defines the internal mechanism (i.e., a backend) of the simulation objects, the OTcl sets up the simulation by assembling and configuring the objects as well as scheduling discrete events (i.e., a frontend).</span></p><p style="color: black; font-family: Arial; font-size: 11pt; line-height: 1.15; margin: 0px; padding-bottom: 10pt; padding-left: 0; padding-right: 0; padding-top: 0pt; padding: 0pt 0px 10pt; text-align: justify;"><span style="color: black; font-family: "Times New Roman"; font-size: 12pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"><br />The C++ and the OTcl are linked together using TclCL. Mapped to a C++ object, variables in the OTcl domains are sometimes referred to as handles. Conceptually, a handle (e.g., n as a Node handle) is just a string (e.g.,_o10) in the OTcl domain, and does not contain any functionality. Instead, the functionality (e.g., receiving a packet) is defined in th mapped C++ object (e.g., of class Connector). In the OTcl domain, a handle acts as a frontend that interacts with users and other OTcl objects.</span></p><p style="color: black; font-family: Arial; font-size: 11pt; height: 11pt; line-height: 1.15; margin: 0px; padding: 0px; text-align: left;"><span style="color: black; font-family: "Arial"; font-size: 11pt; font-style: normal; font-weight: 400; text-decoration: none; vertical-align: baseline;"></span></p></div></td></tr></tbody></table><table role="presentation" style="border-collapse: collapse; width: 100%;"><tbody><tr><td style="padding: 24px 4.5%;"><br /><table dir="ltr" style="border-collapse: collapse; width: 100%;"><tbody></tbody></table></td></tr></tbody></table></td></tr></tbody></table></td></tr></tbody></table><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-90848835771991791372023-08-29T14:05:00.002+05:302023-08-29T14:05:22.891+05:30P2P network Simulation using NS3 | NS3 Tutorial<p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">In this post, we are going to see how to define and design a p2p network between two wired nodes with a decent bandwidth and delay. Here is the problem statement. </p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">NS3 will be used to simulate the network</p><h2 style="text-align: left;">Tools required:</h2><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;"></p><ul style="text-align: left;"><li>NS3 </li><li>Tracemetrics (for measuring throughput)</li><li>NetAnim (for Animation)</li><li>Gnuplot (for plotting the characteristics)</li></ul><p></p><h2 style="text-align: left;"><b>Complete Instructions are available in the video </b></h2><div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="410" src="https://www.youtube.com/embed/NizR6QYaFFo" width="493" youtube-src-id="NizR6QYaFFo"></iframe></div><br /><b><br /></b></div><h2 style="text-align: left;"><b>Problem Statement:</b></h2><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px; text-align: justify;">Design two wired nodes that can connect to each other through a point-to-point network that handles a data rate of 50mbps and a delay of 5ms. The first node acts as a server and the second node acts as a client and they exchange at least 10 packets in a total simulation time of 20 seconds. The maximum packet size is <b>1024</b> bytes and <b>512</b> bytes. Plot the throughput of each node for the above packet sizes. (Use any charting solution you are comfortable with).</p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">NS3 already had this file in the name as first.cc which is located at </p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">~ns-3.38/examples/tutorial/</p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">Copy the above file to ~ns-3.38/scratch/</p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">To run this file, let's open a terminal</p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-size: 16px; margin-bottom: 16px; margin-top: 0px;"><span style="font-family: courier;">$ cd ns-allinone-3.38/ns-3.38</span></p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-size: 16px; margin-bottom: 16px; margin-top: 0px;"><span style="font-family: courier;">$ ./ns3 run scratch/first.cc</span></p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">Change the 1024 to 512 as the packet size changes the 512. tr in the trace file and compile it again</p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-size: 16px; margin-bottom: 16px; margin-top: 0px;"><span style="font-family: courier;">$ ./ns3 run scratch/first.cc</span></p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">The modified code can be downloaded from this location: <a href="https://github.com/tspradeepkumar/ns3Examples">https://github.com/tspradeepkumar/ns3Examples</a></p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">Open another terminal and go to </p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-size: 16px; margin-bottom: 16px; margin-top: 0px;"><span style="font-family: courier;">$ cd ns-allinone-3.38/netanim-3.109/ </span></p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-size: 16px; margin-bottom: 16px; margin-top: 0px;"><span style="font-family: courier;">$ ./NetAnim</span></p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">Open the XML file and check the output in the animator window.</p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">]Now find the throughput with the help of a software called tracemetrics which is already installed. Check the video in my channel for installing tracemetrics</p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; font-size: 16px; margin-bottom: 16px; margin-top: 0px;">Open another terminal or use the existing terminal</p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-size: 16px; margin-bottom: 0px !important; margin-top: 0px;"><span style="font-family: courier;">$ cd </span></p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-size: 16px; margin-bottom: 0px !important; margin-top: 0px;"><span style="font-family: courier;">$ cd tracemetrics-1.4.0 </span></p><p dir="auto" style="-webkit-user-select: auto; box-sizing: border-box; caret-color: rgb(36, 41, 47); color: #24292f; font-size: 16px; margin-bottom: 0px !important; margin-top: 0px;"><span style="font-family: courier;">$ java -jar tracemetrics.jar</span></p><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-84785994666044385622023-07-12T10:49:00.003+05:302023-07-12T10:49:21.118+05:30Netsimulyzer - a 3D visualizer for Network Simulator 3<h1 style="text-align: left;"><b>Netsimulyzer - 3D visualizer</b></h1>Netsimulyzer is a third-party software that can show the visuals of the ns3 output in a 3D virtual world. we can make the nodes look either like land drones, drones, smartphones, etc. We can construct buildings, towers, antennas, etc within the visualizer and the movement of the nodes can be simulated as well. Here is the screenshot of a simulation generated using ns3 and shown in the Netsimulyzer. <div><br /></div><div>This post will help you to understand and install Netsimulyzer in Ubuntu 22.04 and add a module to support ns3 in generating the Netsimulyzer JSON file.<br /><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div><br /></div><div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEg4tLFQR0qFJNOlWEw-v8ykEHvMUHr6OZqjVjkXS56nmhdJinMwfvES9JoG8uD_vgn44hrYhlE4T-AFUdDPdxvLqIafl_2x2gQR19gHbt2dWuUmkJN2JJkw5pyt06Leh9U2_xTccVOy88lghvf95zcH1VQiVYBJ9iyC3BV2-I8If7qkUf-o-bNkdRm8rU4" style="margin-left: auto; margin-right: auto;"><img alt="Netsimulyzer" data-original-height="1055" data-original-width="1848" height="366" src="https://blogger.googleusercontent.com/img/a/AVvXsEg4tLFQR0qFJNOlWEw-v8ykEHvMUHr6OZqjVjkXS56nmhdJinMwfvES9JoG8uD_vgn44hrYhlE4T-AFUdDPdxvLqIafl_2x2gQR19gHbt2dWuUmkJN2JJkw5pyt06Leh9U2_xTccVOy88lghvf95zcH1VQiVYBJ9iyC3BV2-I8If7qkUf-o-bNkdRm8rU4=w640-h366" title="Netsimulyzer" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Netsimulyzer</td></tr></tbody></table><br /><br /></div><h2 style="text-align: left;">Installing Netsimulyzer in Ubuntu and NS3</h2><div><h3 style="text-align: left;">Prerequisites</h3><div><ul style="text-align: left;"><li>Ubuntu 22.04 OS</li><li>ns-3.38</li><li>Netsimulyzer version 1.0.7 </li></ul></div><div>There are older versions also available for other distributions of ubuntu., but we will focus on these versions</div><div><br /></div><h3 style="text-align: left;">Steps for installation:</h3><div><ol style="text-align: left;"><li>ns-3.38 along with Netsimulyzer module to be installed.</li><li>Netsimulyzer software to be installed on Ubuntu 22.04 (the software can be installed in Windows also)</li></ol></div><div>The above software will load the <span style="font-family: courier;">.json</span> script and can be visualized.</div><div><br /></div><h3 style="text-align: left;">Step 1: Installation of ns.3-38</h3><div>Already i published a video in my channel on ns3, you can use the following link to see the video </div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/crIXDeRL3tE" width="320" youtube-src-id="crIXDeRL3tE"></iframe></div><br /><div><br /></div><div><br /></div><div>Open a terminal</div><div><br /></div><div><span style="font-family: courier;">$ sudo apt update</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ sudo apt install cmake pkg-config qtbase5-dev libqt5charts5-dev g++ python3 cmake ninja-build git gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 tcpdump wireshark sqlite sqlite3 libsqlite3-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev doxygen graphviz imagemagick python3-sphinx dia imagemagick texlive dvipng latexmk texlive-extra-utils texlive-latex-extra texlive-font-utils libeigen3-dev gsl-bin libgsl-dev libgslcblas0 libxml2 libxml2-dev libgtk-3-dev lxc-utils lxc-templates vtun uml-utilities ebtables bridge-utils libxml2 libxml2-dev libboost-all-dev </span></div><div><br /></div><div><b>Install the above complete packages for ns-3.38 and as well netsimulyzer</b></div><div><br /></div><div><span style="font-family: courier;">$ cd ns-allinone-3.38/ns-3.38/contrib</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ wget https://github.com/usnistgov/NetSimulyzer-ns3-module/archive/refs/tags/v1.0.7.zip -O NetSimulyzer-ns3-module-master.zip</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ unzip NetSimulyzer-ns3-module-master.zip</span></div><div><br /></div><div><span style="font-family: courier;">$ mv NetSimulyzer-ns3-module-1.0.7 netsimulyzer</span></div><div><br /></div><div>Now </div><div><span style="font-family: courier;">$ cd ../..</span></div><div><span style="font-family: courier;">$ ./build.py --enable-tests --enable-examples </span></div><div><br /></div><div>(The above process will take at least 20 minutes to compile all the packages).</div><div><br /></div><div>Meanwhile, we will go to the second step:</div><h3 style="text-align: left;">Step 2: Installation of Netsimulyzer software in Ubuntu 22.04</h3><div>Open a new terminal and paste the following command </div><div><br /></div><div><span style="font-family: courier;">$ git clone --recursive https://github.com/usnistgov/NetSimulyzer.git</span></div><div><span style="font-family: courier;">$ cd NetSimulyzer/</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ mkdir build</span></div><div><span style="font-family: courier;">$ cd build</span></div><div><br /></div><div><span style="font-family: courier;">$ cmake -DCMAKE_BUILD_TYPE=Release ..</span></div><div><span style="font-family: courier;">$ cmake --build . --parallel </span></div><div>(The above command may throw some error or bug, so you can use the following statement)</div><div>or</div><div><br /></div><div><span style="font-family: courier;">$ cmake --build .</span></div><div>(this will use only one core and hence it will be slow, but it really works)</div><div><br /></div><div>To check whether ns3 was installed successfully, here is the command to check</div><div><span style="font-family: courier;">$ cd ns-3.38</span></div><div><span style="font-family: courier;">$ ./ns3 run hello-simulator</span></div><div><br /></div><div>you get an output of <b>Hello Simulator</b></div><div><br /></div><div><b>To check whether the Netsimulyzer works,</b></div><div>There are some examples in the Netsimulyzer module examples, we can move some of those examples to the scratch folder of ns-3.38 </div><div><br /></div><div>I have copied all the .cc files from the following folder </div><div><span style="font-family: courier;">ns-3.38/contrib/NetSimulyzer/examples </span></div><div>to </div><div><span style="font-family: courier;">ns-3.38/scratch</span></div><div><br /></div><div>and now I am going to run the above example using the following command </div><div><br /></div><div>Open a new terminal </div><div><br /></div><div><span style="font-family: courier;">$ cd ns-allinone-3.38/ns-3.38/</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ ./ns3 run scratch/mobility-buildings-example.cc </span></div><div><br /></div><div>A file with a .json file is created and it can be opened using the Netsimulyzer software</div><div><br /></div><div><span style="font-family: courier;">$ cd NetSimulyzer/build</span></div><div><span style="font-family: courier;">$ ./netsimulyzer</span></div><div><br /></div><div>So both the software is installed.</div><div><br /></div><div><br /></div><div><br /></div></div><div><br /></div></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-71682803560605884272023-07-07T20:52:00.007+05:302023-07-07T20:52:56.368+05:30Installation of ns3 in Ubuntu 22.04 | NS-3.38<div><b><span style="font-size: x-large;">Installation of ns3 in Ubuntu 22.04</span></b></div><div>In this post, we are going to install ns3.38 in Ubuntu 22.04 OS</div><div>After the fresh installation of Ubuntu, perform the following command to run the updates </div><div><br /></div><div>Prerequisites:</div><div><ul style="text-align: left;"><li>Download ns-3.38 from the following link (<a href="https://www.nsnam.org/releases/ns-allinone-3.38.tar.bz2">https://www.nsnam.org/releases/ns-allinone-3.38.tar.bz2</a>)</li><li>Fresh installation of Ubuntu 22.04 </li><li>For complete instructions, follow the video</li></ul><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/crIXDeRL3tE" width="320" youtube-src-id="crIXDeRL3tE"></iframe></div><br /><div><br /></div><h2 style="text-align: left;"><b>Step 1: Install the basic requirements</b></h2></div><div>Open a terminal and just copy and paste the following two lines into a terminal and install it. It will take some time to complete the full process.</div><div><b><span style="font-family: courier;"><br /></span></b></div><div><span style="font-family: courier;">$ sudo apt update</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ sudo apt install g++ python3 cmake ninja-build git gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 tcpdump wireshark sqlite sqlite3 libsqlite3-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools openmpi-bin openmpi-common openmpi-doc libopenmpi-dev doxygen graphviz imagemagick python3-sphinx dia imagemagick texlive dvipng latexmk texlive-extra-utils texlive-latex-extra texlive-font-utils libeigen3-dev gsl-bin libgsl-dev libgslcblas0 libxml2 libxml2-dev libgtk-3-dev lxc-utils lxc-templates vtun uml-utilities ebtables bridge-utils libxml2 libxml2-dev libboost-all-dev </span></div><div><br /></div><div>All these packages are not compulsorily needed, but install these things, or else there may be some bugs that prohibit your code to run.. Hence let's install all these packages. </div><h2 style="text-align: left;"><b>Step 2: Installation of ns3 in the home folder</b></h2><div>Now unzip or untar the ns-allinone-3.38.tar.bz2 to the home folder. in my case, it is </div><div><span style="font-family: courier;">/home/pradeepkumar </span></div><div><br /></div><div>Now successfully extracted. </div><div><br /></div><div>Step 3: </div><div>Now we need to install it by running the command </div><div>Open a new terminal</div><div><br /></div><div><span style="font-family: courier;"><b>$ cd ns-allinone-3.38/</b></span></div><div><span style="font-family: courier;"><b>$ ./build.py --enable-examples --enable-tests </b></span></div><div><br /></div><div><div class="separator" style="clear: both; text-align: center;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHpDBRJnETGSYFdLgvI3e7M-O8T1dqrxQxGx9t9XMNzuTmRaVjalAgOQptYTLanI01I8Y98yuJUNkeztQKX9D4tgE6hSy1mzR50q2NspyGXqdi4fYjiHGAxyNX8sjUWOt_w9Gp5E0jiAkqynW4J6CUfbsonrk-7kfumoraMxOeBWmSboJzM6WPifiPnZc/s1621/Screenshot%20from%202023-07-07%2020-05-39.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="ns3 installation" border="0" data-original-height="173" data-original-width="1621" height="68" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHpDBRJnETGSYFdLgvI3e7M-O8T1dqrxQxGx9t9XMNzuTmRaVjalAgOQptYTLanI01I8Y98yuJUNkeztQKX9D4tgE6hSy1mzR50q2NspyGXqdi4fYjiHGAxyNX8sjUWOt_w9Gp5E0jiAkqynW4J6CUfbsonrk-7kfumoraMxOeBWmSboJzM6WPifiPnZc/w640-h68/Screenshot%20from%202023-07-07%2020-05-39.png" title="ns3 installation" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">ns3 installation<br /><div style="text-align: left;"><br /></div><div style="text-align: left;">After the installation gets over, the output looks like this</div><div style="text-align: left;"><br /></div><div style="text-align: left;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5_Wkc-bfESQRnae5sOe6oYjN7dkQ19FhQGjgqfNBHfEkZbwZ2OlxHWHol-4cvbONOy24fEAnHuYNrjrK5FEP_C-Zn_TDbebzE9OcNqXkeJKwH9xYfbaK11y8-3JV3PcbMd-_dcbOjHBK56MEsOY5_8hlxEhxfhJoRLfIYdBbQGpZmY0-J4pHCOpIeg10/s1846/Screenshot%20from%202023-07-07%2020-49-57.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="ns3 installation" border="0" data-original-height="1053" data-original-width="1846" height="366" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5_Wkc-bfESQRnae5sOe6oYjN7dkQ19FhQGjgqfNBHfEkZbwZ2OlxHWHol-4cvbONOy24fEAnHuYNrjrK5FEP_C-Zn_TDbebzE9OcNqXkeJKwH9xYfbaK11y8-3JV3PcbMd-_dcbOjHBK56MEsOY5_8hlxEhxfhJoRLfIYdBbQGpZmY0-J4pHCOpIeg10/w640-h366/Screenshot%20from%202023-07-07%2020-49-57.png" title="ns3 installation" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">ns3 installation<br /><br /></td></tr></tbody></table></div><div style="text-align: left;"><br /></div><div style="text-align: left;">To check whether ns3 was installed successfully or not, give the following commands</div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">$ cd ns-allinone-3.38/ns-3.38</span></div><div style="text-align: left;"><span style="font-family: courier;">$ ./ns3 run hello-simulator </span></div><div style="text-align: left;"><br /></div><div style="text-align: left;">The output you should get is "<span style="font-family: courier;">Hello Simulator</span>" which indicates that the installation is successful.</div></td></tr></tbody></table><br /><br /></div><div class="separator" style="clear: both; text-align: center;"><br /></div></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjry8uuwELv8CpZ9A2m-TaNAzKLSMHQDRM0cskw16piSjBiY_NQmBgrhFt-X8forbhGZiC-eiaHo9ljDTLisBvvq_aTWl3gW9mQhpUoV6-9zZflebgMHxqd7Q4R3_Rd7hvCjwuTTF__pEwxTfY-1GtrSI90sPrSLRsKzd8zOfF5BNrGlb31rl_hMF8K3s/s1698/Screenshot%20from%202023-07-07%2020-51-45.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Hello Simulator" border="0" data-original-height="371" data-original-width="1698" height="140" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhjry8uuwELv8CpZ9A2m-TaNAzKLSMHQDRM0cskw16piSjBiY_NQmBgrhFt-X8forbhGZiC-eiaHo9ljDTLisBvvq_aTWl3gW9mQhpUoV6-9zZflebgMHxqd7Q4R3_Rd7hvCjwuTTF__pEwxTfY-1GtrSI90sPrSLRsKzd8zOfF5BNrGlb31rl_hMF8K3s/w640-h140/Screenshot%20from%202023-07-07%2020-51-45.png" title="Hello Simulator" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Hello Simulator</td></tr></tbody></table><div><br /></div><div><br /></div><div>Follow me on,</div><div>Instagram - https://www.instagram.com/tspradeepkumar </div><div>Facebook - https://www.facebook.com/tspradeep </div><div>Twitter - https://twitter.com/tspradeepkumar </div><div>________________________________</div><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-91214464591883321662023-04-08T08:26:00.000+05:302023-04-08T08:26:02.081+05:30SUMO Emission of Vehicles | VANETs<h2 style="text-align: left;">Emission of Gases by Vehicles using SUMO</h2>In this post, we will be discussing how floating cars can emit gases namely <script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div>Carbon Monoxide (CO)</div><div>Carbon Dioxide (CO2)</div><div>Hydro Carbons (HC)</div><div>Particle Matter (PMx)</div><div>Nitrous Oxide (NOx)</div><div><br /></div><div>SUMO generates this emission of gases based on the EU4 norms. How to capture these gases in our simulation? </div><div><br /></div><div>The following video contains complete information</div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/7sLdgzvrx2s" width="320" youtube-src-id="7sLdgzvrx2s"></iframe></div><br /><div><br /></div><h3 style="text-align: left;"><span style="font-size: medium;">Prerequisites</span></h3><div>1. SUMO to be installed in Ubuntu (<a href="https://www.nsnam.com/2019/06/installation-of-sumo-120-in-ubuntu-1804.html" target="_blank">SUMO installation</a>)</div><div>2. Python3 to be installed</div><div>3. Knowledge of XML files</div><div><br /></div><div>The following is the image of the road design I have created, </div><div>there are a totally of 6 junctions ( 0 to 5) and two edges from one junction to another intersection (each edge has two lanes). All the junctions are priority junctions except 2 and 5. These junctions are traffic light junctions.</div><div><br /></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLSQgPh3mAKljK7Xg2W5VdgV-p1G_pC7h49CewF9jlSPH0dyPIfg7TyfOxpa_927N_qtqsZUMzTFZ8Yr0ii-5P_tF2qc9bx5RsTMSW2-TVm6e8gnB-GI12ByNJ0HfbUJpKDXBr4jQud2Iqk8pUTXb8RKDEntqgOepvo7zoNSvOVajKA4fydbYLlwg0/s1024/WhatsApp%20Image%202023-04-07%20at%2021.42.40.jpeg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="VANET" border="0" data-original-height="589" data-original-width="1024" height="368" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLSQgPh3mAKljK7Xg2W5VdgV-p1G_pC7h49CewF9jlSPH0dyPIfg7TyfOxpa_927N_qtqsZUMzTFZ8Yr0ii-5P_tF2qc9bx5RsTMSW2-TVm6e8gnB-GI12ByNJ0HfbUJpKDXBr4jQud2Iqk8pUTXb8RKDEntqgOepvo7zoNSvOVajKA4fydbYLlwg0/w640-h368/WhatsApp%20Image%202023-04-07%20at%2021.42.40.jpeg" title="VANET" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Custom road design in SUMO</td></tr></tbody></table><div><br /></div><div><div>We are going to design a custom road. </div><div><br /></div><div>In our machine, I will store all the files in a folder called </div><div>/home/pradeepkumar/customroad</div><div>Step 1: Creation of a node file that contains the information about the junctions</div><div>Extension of the file would be .nod.xml</div><div><br /></div><div><span style="font-family: courier;"><nodes> <!-- The opening tag --></span></div><div><span style="font-family: courier;"> <node id="0" x="400.0" y="700.0" type="priority"/> <!-- def. of node "0" --></span></div><div><span style="font-family: courier;"> <node id="1" x="700.0" y="700.0" type="priority"/> <!-- def. of node "1" --></span></div><div><span style="font-family: courier;"> <node id="2" x="900.0" y="500.0" type="traffic_light"/> </span></div><div><span style="font-family: courier;"> <node id="3" x="700.0" y="300.0" type="priority"/></span></div><div><span style="font-family: courier;"> <node id="4" x="400.0" y="300.0" type="priority"/> <!-- def. of node "4" --></span></div><div><span style="font-family: courier;"> <node id="5" x="200.0" y="500.0" type="traffic_light"/> </span></div><div><span style="font-family: courier;"></nodes> <!-- The closing tag --></span></div><div><br /></div><div>Step 2: Creation of edges (roads connecting the junction).</div><div>Extn: .edg.xml</div><div><br /></div><div><span style="font-family: courier;"><edges></span></div><div><span style="font-family: courier;"> <edge id="l01" from="0" to="1" priority="2" numLanes="2" speed="11.11"/></span></div><div><span style="font-family: courier;"> <edge id="r01" from="1" to="0" priority="3" numLanes="2" speed="13.89"/></span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;"> <edge id="u12" from="1" to="2" priority="1" numLanes="2" speed="11.11"/></span></div><div><span style="font-family: courier;"> <edge id="d12" from="2" to="1" priority="2" numLanes="2" speed="11.11"/></span></div><div><span style="font-family: courier;"> </span></div><div><span style="font-family: courier;"> <edge id="d23" from="2" to="3" priority="3" numLanes="2" speed="13.89"/></span></div><div><span style="font-family: courier;"> <edge id="u23" from="3" to="2" priority="1" numLanes="2" speed="11.11"/></span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;"> <edge id="l43" from="3" to="4" priority="2" numLanes="2" speed="11.11"/></span></div><div><span style="font-family: courier;"> <edge id="r43" from="4" to="3" priority="3" numLanes="2" speed="13.89"/></span></div><div><span style="font-family: courier;"> </span></div><div><span style="font-family: courier;"> <edge id="d54" from="5" to="4" priority="1" numLanes="2" speed="11.11"/></span></div><div><span style="font-family: courier;"> <edge id="u54" from="4" to="5" priority="2" numLanes="2" speed="11.11"/></span></div><div><span style="font-family: courier;"> </span></div><div><span style="font-family: courier;"> <edge id="d05" from="0" to="5" priority="3" numLanes="2" speed="13.89"/></span></div><div><span style="font-family: courier;"> <edge id="u05" from="5" to="0" priority="1" numLanes="2" speed="11.11"/></span></div><div><span style="font-family: courier;"> </span></div><div><span style="font-family: courier;"> <edge id="l52" from="5" to="2" priority="3" numLanes="2" speed="13.89"/></span></div><div><span style="font-family: courier;"> <edge id="r52" from="2" to="5" priority="1" numLanes="2" speed="11.11"/></span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;"></edges></span></div><div><br /></div><div>Step 3: create a net.xml file using the node and edge files.</div><div><br /></div><div>$ netconvert -n file.nod.xml -e file.edg.xml -o file.net.xml</div><div>$ The location of the file in my machine is /home/pradeepkumar/customroad/ </div><div><br /></div><div>Step 4: Creation of random trips</div><div>There is a file called </div><div>tools/randomTrips.py that can generate vehicles on the network</div><div><br /></div><div>$ python3 ../sumo/tools/randomTrips.py -n file.net.xml -r file.rou.xml -b 0 -e 1000 -l </div><div><br /></div><div>Step 5: Create a file called file.sumo.cfg (to run with sumo for air pollution)</div><div><span style="font-family: courier;"><configuration></span></div><div><span style="font-family: courier;"><input></span></div><div><span style="font-family: courier;"><net-file value="file.net.xml"/> </span></div><div><span style="font-family: courier;"><route-files value="file.rou.xml"/></span></div><div><span style="font-family: courier;"></input></span></div><div><span style="font-family: courier;"><time></span></div><div><span style="font-family: courier;"><begin value="0"/></span></div><div><span style="font-family: courier;"><end value="1000"/></span></div><div><span style="font-family: courier;"><step-length value="0.5"/></span></div><div><span style="font-family: courier;"></time></span></div><div><span style="font-family: courier;"></configuration></span></div><div><br /></div><div><span style="font-family: courier;">$ sumo-gui file.sumo.cfg</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">Here is the screenshot of the roads and the traffic light junctions</span></div><div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifgjzsO2BnJAvfXqCUrhdaj9ibEpHsuunSKXbE-inmASFx-LTjDrQwR-uH1IDVeUFEu7UsZ60IvkSBzs79YQDQ8htHPAdE8NZsobgxhgQrfCCp_RM1f-BJo5_pe1qL53ka-ipF-DXqS7kpa1XEUMaS2dzIViyyZVWJT0Dn9k3HIQTT8yPu1UJjbmrZ/s1850/sumo1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="SUMO" border="0" data-original-height="1055" data-original-width="1850" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEifgjzsO2BnJAvfXqCUrhdaj9ibEpHsuunSKXbE-inmASFx-LTjDrQwR-uH1IDVeUFEu7UsZ60IvkSBzs79YQDQ8htHPAdE8NZsobgxhgQrfCCp_RM1f-BJo5_pe1qL53ka-ipF-DXqS7kpa1XEUMaS2dzIViyyZVWJT0Dn9k3HIQTT8yPu1UJjbmrZ/w640-h364/sumo1.png" title="SUMO" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">SUMO</td></tr></tbody></table><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOyMmjAVjesFflmW1s8b1-0Az-DDOGqIj2uhSCC4Fyehz4VE_NO8SyKQpq1DAddKjNyK0dJ95o0v7NDxrICTHNoiuk6t0Y5nLwlY3KhJC5bR3V12-sPpwLO4PtD7dXglNap-7DXxUwF0zH-qs7-KaoPXwJsU-h24vzXgEUyAiwp_LeVgaE8zuYXKQp/s1850/sumo2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="SUMO VANET" border="0" data-original-height="1055" data-original-width="1850" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOyMmjAVjesFflmW1s8b1-0Az-DDOGqIj2uhSCC4Fyehz4VE_NO8SyKQpq1DAddKjNyK0dJ95o0v7NDxrICTHNoiuk6t0Y5nLwlY3KhJC5bR3V12-sPpwLO4PtD7dXglNap-7DXxUwF0zH-qs7-KaoPXwJsU-h24vzXgEUyAiwp_LeVgaE8zuYXKQp/w640-h364/sumo2.png" title="SUMO VANET" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">SUMO Traffic light junction</td></tr></tbody></table><br /><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ sumo -c file.sumo.cfg --emission-output emission.xml --emission-output.geo --battery-output battery.xml --fcd-output car.xml --summary-output summary.xml --collision-output collision.xml --statistic-output stats.xml </span></div><div><br /></div><div>To convert the XML files into CSV files, here is the step</div><div><br /></div><div>Convert the emission.xml to emission.csv file</div><div><br /></div><div>$ python3 ../sumo/tools/xml/xml2csv.py emission.xml -o emission.csv</div><div><br /></div><div>Here is the file content of the emission.csv file. Using these data, we can predict or analyze various results of the emission of gases to counter air pollution. These kinds of systems can be demonstrated as Automotive cyber-physical systems </div><div><br /></div><div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhV9pcR4tJnm4TXqrzJB24jCjtJO5WHbvbAwtTAebuv1rzYYf7WwA6XihJQgByLaGb1XL88A3KYkbBR8Lw2uLCBYkip7a8T65uDAxayApcMM5liZKmStWAR9p1mND_p1lVM83t7hT-mbcXBjgXgmnbCFXD9l2fQX9l7WTGSpHl4VJ4VFcktKI7rDLzn" style="margin-left: auto; margin-right: auto;"><img alt="emission" data-original-height="119" data-original-width="750" height="102" src="https://blogger.googleusercontent.com/img/a/AVvXsEhV9pcR4tJnm4TXqrzJB24jCjtJO5WHbvbAwtTAebuv1rzYYf7WwA6XihJQgByLaGb1XL88A3KYkbBR8Lw2uLCBYkip7a8T65uDAxayApcMM5liZKmStWAR9p1mND_p1lVM83t7hT-mbcXBjgXgmnbCFXD9l2fQX9l7WTGSpHl4VJ4VFcktKI7rDLzn=w640-h102" title="emission" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Emission data of floating cars from SUMO simulation</td></tr></tbody></table><br /></div><div><br /></div><div>This example shows the emission data of floating cars in SUMO simulation. </div><div><br /></div><div>The roads are user-designed roads. </div><div><br /></div><div>Thanks for watching </div><div><br /></div><div>https://github.com/tspradeepkumar</div><div>https://www.nsnam.com</div></div><div><br /></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-69133717651897562702023-02-13T09:44:00.006+05:302023-02-13T09:44:58.537+05:30How to write Publisher Subscriber in ROS Noetic | Step by Step instructions<h2 style="text-align: left;">ROS1 Noetic -Publisher and Subscriber Example</h2><div>This post tells about the implementation of a publisher and a subscriber in ROS Noetic. </div><div><br /></div><div><br /></div><div>In this example, we have considered the following:</div><div><b>Example 1: </b></div><div>One publisher (pub.py) and one Subscriber (Sub.py)</div><div>Topic: <b>first_lecture</b></div><div><b>Message: String Message </b></div><div><b><br /></b></div><div><b>Example 2:</b></div><div>Two publishers (pub.py and pub1.py) and</div><div>Two subscribers (sub.py and sub1.py)</div><div>Topic: <b>first_lecture</b> </div><div><b><br /></b></div><div><b>See the following video for step by step instructions for running this example:</b></div><div><b><br /></b></div><div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/a9AhWZoixM8" width="478" youtube-src-id="a9AhWZoixM8"></iframe></div><br /><b><br /></b></div><div><b>The following picture shows the nodes (The picture is taken by running the rqt_graph command)</b></div><div style="text-align: left;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrr6l1EDQ2bLxkGAgAH6UH6H9sW67wgQ0tWxvqYpcp6q7J2VpVkqLjUc9trG8SWS_1ea27ryjw4QZr8tHq0AY8pPcwOqYbRpTRI3Nw3YaBUCaBeXeyOHreskaG9sYRvl8FY0wutHNpeNQKrWvYp0CfUsm8IuYb1jxMr2AbbRtvD6nTBP58KDjbWvWK/s1920/rqt.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="ROS Noetic" border="0" data-original-height="1080" data-original-width="1920" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhrr6l1EDQ2bLxkGAgAH6UH6H9sW67wgQ0tWxvqYpcp6q7J2VpVkqLjUc9trG8SWS_1ea27ryjw4QZr8tHq0AY8pPcwOqYbRpTRI3Nw3YaBUCaBeXeyOHreskaG9sYRvl8FY0wutHNpeNQKrWvYp0CfUsm8IuYb1jxMr2AbbRtvD6nTBP58KDjbWvWK/w640-h360/rqt.png" title="Ros Noetic" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Publisher Subscriber in ROS Noetic</td></tr></tbody></table><h3><br />How to run in ROS Noetic</h3></div><div>Prerequsities </div><div>1. Ubuntu Basic commands</div><div>2. PATH Setting in Ubuntu</div><div>3. Basic knowledge of Linux </div><div>4. Programming fundamentals</div><div><br /></div><div>To Install ROS1 Noetic in Ubuntu 20.04, you can refer the following video in my channel.</div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/v22t0lKgjJA" width="462" youtube-src-id="v22t0lKgjJA"></iframe></div><br /><div><br /></div><div>ROS is enabled with a catkin make system which perform the easier build operation and cross compilation enablement.</div><div><br /></div><h4 style="text-align: left;">Create a workspace to store all our files.</h4><div><span style="font-family: courier;">/home/pradeepkumar/pradeep_ws </span></div><div><br /></div><div>To create a workspace:</div><div>Open a terminal </div><div><br /></div><div><span style="font-family: courier;">$ mkdir -p pradeep_ws/src</span></div><div><span style="font-family: courier;">$ cd pradeep_ws/</span></div><div><span style="font-family: courier;">$ catkin_make </span></div><div><br /></div><div>Then set the path </div><div>Copy the following line in the <span style="font-family: courier;">/home/pradeepkumar/.bashrc </span>file </div><div><br /></div><div><span style="font-family: courier;">source /home/pradeepkumar/pradeep_ws/devel/setup.bash</span></div><div><br /></div><div>]alternative way to set the environment, but for every terminal to be opened, we need to do the following step.</div><div><span style="font-family: courier;">$ source $HOME/pradeep_ws/devel/setup.bash</span></div><div><br /></div><div>To create a Catkin package, here is the command</div><div><span style="font-family: courier;">$ cd pradeep_ws/src</span></div><div><br /></div><div><span style="font-family: courier;">$ catkin_create_pkg ros_tutorial1 rospy std_msgs</span></div><div><br /></div><div><span style="font-family: courier;">$ cd pradeep_ws/src/ros_tutorial1</span></div><div><br /></div><div><span style="font-family: courier;">$ mkdir script</span></div><div><br /></div><div>create the pub.py, pub1.py, sub.py and sub1.py (You can download the source code from <a href="https://github.com/tspradeepkumar/ROSNoteic" rel="nofollow" target="_blank">https://github.com/tspradeepkumar/ROSNoteic </a></div><div><br /></div><div><span style="font-family: courier;">$ chmod 777 *.py</span></div><div><br /></div><div>ROS Noetic runs always with a master that means it should run roscore to run all the ros applications.</div><div><br /></div><div>You need to open 5 Terminals and give the commands in each of the terminals</div><div><ul style="text-align: left;"><li><span style="font-family: courier;">$ roscore</span></li><li><div><span style="font-family: courier;">$ rosrun ros_tutorial1 pub.py</span></div></li><li><div><div><span style="font-family: courier;">$ rosrun ros_tutorial1 pub1.py</span></div></div></li><li><div><div><span style="font-family: courier;">$ rosrun ros_tutorial1 sub.py</span></div></div></li><li><div><div><span style="font-family: courier;">$ rosrun ros_tutorial1 sub1.py</span></div></div></li></ul></div><div><br /></div><div>Open a terminal and run the command roscore</div><div><span style="font-family: courier;">$ roscore</span></div><div><br /></div><div>Open another terminal for publisher and run the following command </div><div><br /></div><div><span style="font-family: courier;">$ rosrun ros_tutorial1 pub.py</span></div><div>You will get the output as ROS Noetic World</div><div><br /></div><div>If ros_tutorial1 is not found, then set the following command and try again </div><div><br /></div><div><span style="font-family: courier;">$ source $HOME/pradeep_ws/devel/setup.bash</span></div><div><br /></div><div>Open one more ternminal for the subscriber and run the following command </div><div><br /></div><div><span style="font-family: courier;">$ rosrun ros_tutorial1 sub.py</span></div><div>You will get the output as I learn about ROS Noetic World. </div><div><br /></div><div>Run the following command to know about the graph </div><div><span style="font-family: courier;">$ rqt_graph </span></div><div><br /></div><div>You can see the following graph (You need to untick the Debug checkbox, to see the complete nodes running in ROS Noetic) </div><div><br /></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnG64OWHUJ-em3XzZmLWNSxBtuLHuuw9AJpBfbrjrYmNYKj-qbSL-WNtOKJdhIevT2tFchth6MmuUNIcqUPn044GlmR9gNwUdBbbrTk4oUjB3fEGFd-g_xs5OZPB_EvDOX05SGfFGUWplvjwRXSeXP_hLwxQq8UKqyVeZnMMyVsAAifRNLf3hfZGbK/s1920/rqt1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="ROS Noetic" border="0" data-original-height="1080" data-original-width="1920" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnG64OWHUJ-em3XzZmLWNSxBtuLHuuw9AJpBfbrjrYmNYKj-qbSL-WNtOKJdhIevT2tFchth6MmuUNIcqUPn044GlmR9gNwUdBbbrTk4oUjB3fEGFd-g_xs5OZPB_EvDOX05SGfFGUWplvjwRXSeXP_hLwxQq8UKqyVeZnMMyVsAAifRNLf3hfZGbK/w640-h360/rqt1.png" title="ROS Noetic" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">ROS Noetic Pub Sub</td></tr></tbody></table><br /><div><br /></div><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-62721094547964994282023-02-02T13:33:00.003+05:302023-02-02T13:33:51.034+05:30Telnet and FTP in Wired networks using NS2 (Network Simulator 2)<script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><h1 style="text-align: left;">Telnet and FTP for a Wired Networks</h1><div>This post tells about the use of Telnet and FTP in Network Simulator 2 for a wired network. This can be extended to a wireless network as well.</div><div><br /></div><div>The following is the source code for implementing Telnet and FTP application in a Wired network scenario. </div><div><br /></div><div>The network looks like this:</div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje0zBginbMqeqnW0b1ouipmlUwRWgXm1aMnu65f2FL8eD3u3jzuLBEZVIn0hqnIS0Cmc4nSXn-v2foUNwrQTrGrijOo0YxVyGcaTNI9Yh_7We7UdDT2wrOGFqAEkNDw37rHsR9KWHZ4blAKp8t0vstFHReuKy_9IaiYcpHzdWmvFm3oQ7VFuk_dG-2/s742/network.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Telnet" border="0" data-original-height="703" data-original-width="742" height="606" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje0zBginbMqeqnW0b1ouipmlUwRWgXm1aMnu65f2FL8eD3u3jzuLBEZVIn0hqnIS0Cmc4nSXn-v2foUNwrQTrGrijOo0YxVyGcaTNI9Yh_7We7UdDT2wrOGFqAEkNDw37rHsR9KWHZ4blAKp8t0vstFHReuKy_9IaiYcpHzdWmvFm3oQ7VFuk_dG-2/w640-h606/network.png" title="Telnet" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Telnet in NS2</td></tr></tbody></table><br /><div>Node 0 to Node 2 is enabled with Telnet Application and Node 1 to Node 3 is enabled with FTP Application. Save the following file as wired.tcl</div><div><pre style="overflow-wrap: break-word; white-space: pre-wrap;">#===================================
# Simulation parameters setup
#===================================
set val(stop) 10.0 ;# time of simulation end
#===================================
# Initialization
#===================================
#Create a ns simulator
set ns [new Simulator]
#Open the NS trace file
set tracefile [open out.tr w]
$ns trace-all $tracefile
#Open the NAM trace file
set namfile [open out.nam w]
$ns namtrace-all $namfile
#===================================
# Nodes Definition
#===================================
#Create 5 nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
#===================================
# Links Definition
#===================================
#Createlinks between nodes
$ns duplex-link $n0 $n4 100.0Mb 10ms DropTail
$ns queue-limit $n0 $n4 50
$ns duplex-link $n1 $n4 100.0Mb 10ms DropTail
$ns queue-limit $n1 $n4 50
$ns duplex-link $n2 $n4 100.0Mb 10ms DropTail
$ns queue-limit $n2 $n4 50
$ns duplex-link $n3 $n4 100.0Mb 10ms DropTail
$ns queue-limit $n3 $n4 50
$ns duplex-link $n3 $n0 100.0Mb 10ms DropTail
$ns queue-limit $n3 $n0 50
# Agents Definition
#===================================
#Setup a UDP connection
set tcp0 [new Agent/TCP]
$ns attach-agent $n0 $tcp0
set sink1 [new Agent/TCPSink]
$ns attach-agent $n2 $sink1
$ns connect $tcp0 $sink1
#Setup a UDP connection
set udp1 [new Agent/UDP]
$ns attach-agent $n1 $udp1
set null3 [new Agent/Null]
$ns attach-agent $n3 $null3
$ns connect $udp1 $null3
$udp1 set packetSize_ 1500
#===================================
# Applications Definition
#===================================
#Setup a FTP Application over TCP connection
set ftp1 [new Application/FTP]
$ftp1 attach-agent $tcp0
$ns at 1.0 "$ftp1 start"
$ns at 10.0 "$ftp1 stop"
#Setup a Telnet Application over UDP connection
set telnet0 [new Application/Telnet]
$telnet0 set interval_ 0.001
$telnet0 attach-agent $udp1
$ns at 1.0 "$telnet0 start"
$ns at 10.0 "$telnet0 stop"
#$ns at 10.0 "$cbr1 stop"
$telnet0 set type_ Telnet
#===================================
# Termination
#===================================
#Define a 'finish' procedure
proc finish {} {
global ns tracefile namfile
$ns flush-trace
close $tracefile
close $namfile
exec nam out.nam &
exit 0
}
$ns at $val(stop) "$ns nam-end-wireless $val(stop)"
$ns at $val(stop) "finish"
$ns at $val(stop) "puts \"done\" ; $ns halt"
$ns run
</pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;"><br /></pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;">When you run the above file using the command </pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;">$ ns wired.tcl </pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;">and the output generated is out.nam and out.tr </pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;">The packet transmission is shown like this in the animation window:</pre><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDqSiaV70VYoQmoclEIPd0DXn3dliKp_CQe0J4ZgveCbW-bqN-PXb-O0UWn4oEenbF-unNQrs3YNfnGZBSRDait7ec2QmjDhjnvYuSx7plJwDO2xvFJryUGxB1Fod9rzjlXfaJNh9lDoWdlCU0qRf9Bc7c5uAXF0HyB9jpETtZ5b5p8DaWhJib_5Fd/s717/network2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Telnet in NS2" border="0" data-original-height="694" data-original-width="717" height="620" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDqSiaV70VYoQmoclEIPd0DXn3dliKp_CQe0J4ZgveCbW-bqN-PXb-O0UWn4oEenbF-unNQrs3YNfnGZBSRDait7ec2QmjDhjnvYuSx7plJwDO2xvFJryUGxB1Fod9rzjlXfaJNh9lDoWdlCU0qRf9Bc7c5uAXF0HyB9jpETtZ5b5p8DaWhJib_5Fd/w640-h620/network2.png" title="Telnet in NS2" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Telnet in ns2</td></tr></tbody></table><br /><br />Node 0 to Node 2 is enabled with Telnet Application and Node 1 to Node 3 is enabled with FTP Application, which is shown in the above picture.</div><div>To get the throughput of the above file in bits per second, here is the awk script: </div><div>Save the following in a file called telnet.awk and store in the same place where the wired.tcl is also stored. </div><div><br /></div><div><pre style="overflow-wrap: break-word; white-space: pre-wrap;">BEGIN {
numTCP1=0;
tcpSize1=0;
numTCP2=0;
tcpSize2=0;
totaltcp1=0;
totaltcp2=0;
}
{
event=$1;
pkttype= $5;
fromnode=$9;
tonode=$10;
pktsize=$6;
if(event == "r" &&pkttype == "udp" &&fromnode == "1.0" &&tonode == "3.0")
{
numTCP1++;
tcpSize1 = pktsize;
}
if(event == "r" &&pkttype == "tcp" &&fromnode == "0.0" &&tonode == "2.0")
{
numTCP2++;
tcpSize2 = pktsize;
}
}
END {
totaltcp1=numTCP1*tcpSize1*8;
totaltcp2=numTCP2*tcpSize2*8;
throughputtcp1= totaltcp1/24; # because simulation time is 24.5 0.5 = 24
throughputtcp2= totaltcp2/24; # because simulation time is 24.5 0.5 = 24
printf("The Throughput of FTP application is %d \n", throughputtcp1);
printf("The Throughput of TELNET application is %d \n", throughputtcp2);
}
</pre><div id="EXKa2" style="-webkit-tap-highlight-color: transparent; background-color: black; color: white; contain: size layout style paint; font-family: Helvetica, Arial, sans-serif; font-size: 16px; height: 948px; opacity: 0; overflow: hidden; position: fixed; top: 0px; touch-action: none; transition: none 0s ease 0s; user-select: none; visibility: hidden; width: 1848px; z-index: 99999;"><div class="V9i-A" data-app="pzpz-app" style="background-position: 50% center; background-repeat: no-repeat; background-size: 42px 42px; height: 948px; opacity: 0; position: absolute; top: 0px; width: 1848px;"></div><div class="_3BMyd" style="contain: size layout style; height: 948px; pointer-events: none; position: absolute; top: 0px; transition: transform 1s cubic-bezier(0.1, 1, 0.1, 1) 0s; width: 1848px;"><div class="_1gLnF" style="contain: size layout style; height: 948px; position: absolute; top: 0px; width: 1848px;"></div></div><div class="uMhfm" data-app="pzpz-app" style="align-items: center; background-color: #0d0a0a; bottom: 0px; display: flex; height: 100px; position: absolute; width: 1848px; z-index: 9999999;"></div><div class="_1hZY3" style="background-color: rgba(0, 0, 0, 0.45); contain: size layout style paint; height: 50px; position: absolute; text-align: right; top: 0px; transform: translateY(-100px); transition: transform 0.35s ease-out 0s; width: 1848px;"><div class="_31E0P" style="display: inline-block; float: left; height: 50px; line-height: 50px; opacity: 0.5; padding-left: 20px; padding-right: 20px; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _1ZRF0" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyLjUiIHZpZXdCb3g9Ii0xIC0xIDI2IDI2IiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTggM0g1YTIgMiAwIDAwLTIgMnYzbTE4IDBWNWEyIDIgMCAwMC0yLTJoLTNtMCAxOGgzYTIgMiAwIDAwMi0ydi0zTTMgMTZ2M2EyIDIgMCAwMDIgMmgzIi8+PC9zdmc+"); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _2tK8N" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijk2IiB3aWR0aD0iOTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTIwIDcxLjMxMUMxNS4zNCA2OS42NyAxMiA2NS4yMyAxMiA2MFYyMGMwLTYuNjMgNS4zNy0xMiAxMi0xMmg0MGM1LjIzIDAgOS42NyAzLjM0IDExLjMxMSA4SDI0Yy0yLjIxIDAtNCAxLjc5LTQgNHY1MS4zMTF6Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTkyIDc2VjM2YzAtNi42My01LjM3LTEyLTEyLTEySDQwYy02LjYzIDAtMTIgNS4zNy0xMiAxMnY0MGMwIDYuNjMgNS4zNyAxMiAxMiAxMmg0MGM2LjYzIDAgMTItNS4zNyAxMi0xMnptLTUyIDRjLTIuMjEgMC00LTEuNzktNC00VjM2YzAtMi4yMSAxLjc5LTQgNC00aDQwYzIuMjEgMCA0IDEuNzkgNCA0djQwYzAgMi4yMS0xLjc5IDQtNCA0SDQweiIvPjwvc3ZnPg=="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _12Ws_" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC4zNS00LjM1TTggMTFoNiIvPjwvc3ZnPg=="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _2Fw8Z" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC4zNS00LjM1TTExIDh2Nk04IDExaDYiLz48L3N2Zz4="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _3edFG" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0IiB2ZXJzaW9uPSIxLjIiIHZpZXdCb3g9IjIgMiAyMCAyMCIgd2lkdGg9IjI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGZpbGw9IiNmZmYiPjxwYXRoIGQ9Ik0xMiA0YTggOCAwIDEwMCAxNiA4IDggMCAwMDAtMTZ6bTAgMTRhNiA2IDAgMTEwLTEyIDYgNiAwIDAxMCAxMnoiLz48cGF0aCBkPSJNMTIgN3YxMGMyLjc1NyAwIDUtMi4yNDMgNS01cy0yLjI0My01LTUtNXoiLz48L2c+PC9zdmc+"); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs fE8zg" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSItMC41IC0wLjUgMjUgMjUiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIvPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xMCA4bDYgNC02IDRWOHoiLz48L3N2Zz4="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _37mMZ" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIyIDIgMjAgMjAiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTggNkw2IDE4TTYgNmwxMiAxMiIvPjwvc3ZnPg=="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div></div><div class="_qWfy" style="background-color: rgba(255, 255, 255, 0.45); height: 3px; position: absolute; top: 0px; transform: translateX(-100%); transition: transform 1s linear 0s; width: 1848px;"></div><div class="_3m3Ci _2Ncen" style="background-color: rgba(0, 0, 0, 0.45); background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1IDE4bC02LTYgNi02Ii8+PC9zdmc+"); background-position: 50% center; background-repeat: no-repeat; background-size: 30px 30px; border-radius: 100%; box-sizing: border-box; cursor: pointer; height: 50px; left: 20px; margin-top: -25px; opacity: 0.65; padding: 10px; position: absolute; top: 474px; transform: translateX(-100px); transition: transform 0.35s ease-out 0s, opacity 0.2s ease-out 0s; width: 50px;"></div><div class="_3m3Ci _33r5o" style="background-color: rgba(0, 0, 0, 0.45); background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1IDE4bC02LTYgNi02Ii8+PC9zdmc+"); background-position: 50% center; background-repeat: no-repeat; background-size: 30px 30px; border-radius: 100%; box-sizing: border-box; cursor: pointer; height: 50px; left: auto; margin-top: -25px; opacity: 0.65; padding: 10px; position: absolute; right: 20px; top: 474px; transform: translateX(100px) scaleX(-1); transition: transform 0.35s ease-out 0s, opacity 0.2s ease-out 0s; width: 50px;"></div><div class="FMmo6" style="background-color: rgba(0, 0, 0, 0.45); bottom: 0px; contain: layout style paint; left: 0px; line-height: 1.35em; padding: 20px 25px; pointer-events: none; position: absolute; right: 0px;"><div class="xrK4d" style="font-size: 20px; padding-bottom: 10px;"></div><div class="undefined"></div></div></div><div class="_2bmqy" style="bottom: 2px; opacity: 0.1; position: fixed; right: 2px; z-index: 999999;"><label class="_10ATy" style="display: inline-block; height: 10px; position: relative; width: 20px;" title="Toggle enabled Zoom photos"><input checked="" id="zps-switch-show" style="height: 0px; opacity: 0; width: 0px;" type="checkbox" /></label></div><div><label class="_10ATy" style="display: inline-block; height: 10px; position: relative; width: 20px;" title="Toggle enabled Zoom photos"><br /></label></div><pre style="overflow-wrap: break-word; white-space: pre-wrap;">The above file can be run using the command:</pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;">$ gawk -f telnet.awk out.tr</pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;">The above command will print the following two lines which informs the throughput of using Telnet and FTP</pre><pre style="overflow-wrap: break-word;"><span style="white-space: pre-wrap;"><b>The Throughput of FTP application is 8962000
The Throughput of TELNET application is 3058293
</b></span></pre><div><br /></div><div id="EXKa2" style="-webkit-tap-highlight-color: transparent; background-color: black; color: white; contain: size layout style paint; font-family: Helvetica, Arial, sans-serif; font-size: 16px; height: 948px; opacity: 0; overflow: hidden; position: fixed; top: 0px; touch-action: none; transition: none 0s ease 0s; user-select: none; visibility: hidden; width: 1833px; z-index: 99999;"><div class="V9i-A" data-app="pzpz-app" style="background-position: 50% center; background-repeat: no-repeat; background-size: 42px 42px; height: 948px; opacity: 0; position: absolute; top: 0px; width: 1833px;"></div><div class="_3BMyd" style="contain: size layout style; height: 948px; pointer-events: none; position: absolute; top: 0px; transition: transform 1s cubic-bezier(0.1, 1, 0.1, 1) 0s; width: 1833px;"><div class="_1gLnF" style="contain: size layout style; height: 948px; position: absolute; top: 0px; width: 1833px;"></div></div><div class="uMhfm" data-app="pzpz-app" style="align-items: center; background-color: #0d0a0a; bottom: 0px; display: flex; height: 100px; position: absolute; width: 1833px; z-index: 9999999;"></div><div class="_1hZY3" style="background-color: rgba(0, 0, 0, 0.45); contain: size layout style paint; height: 50px; position: absolute; text-align: right; top: 0px; transform: translateY(-100px); transition: transform 0.35s ease-out 0s; width: 1833px;"><div class="_31E0P" style="display: inline-block; float: left; height: 50px; line-height: 50px; opacity: 0.5; padding-left: 20px; padding-right: 20px; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _1ZRF0" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyLjUiIHZpZXdCb3g9Ii0xIC0xIDI2IDI2IiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTggM0g1YTIgMiAwIDAwLTIgMnYzbTE4IDBWNWEyIDIgMCAwMC0yLTJoLTNtMCAxOGgzYTIgMiAwIDAwMi0ydi0zTTMgMTZ2M2EyIDIgMCAwMDIgMmgzIi8+PC9zdmc+"); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _2tK8N" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijk2IiB3aWR0aD0iOTYiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTIwIDcxLjMxMUMxNS4zNCA2OS42NyAxMiA2NS4yMyAxMiA2MFYyMGMwLTYuNjMgNS4zNy0xMiAxMi0xMmg0MGM1LjIzIDAgOS42NyAzLjM0IDExLjMxMSA4SDI0Yy0yLjIxIDAtNCAxLjc5LTQgNHY1MS4zMTF6Ii8+PHBhdGggZmlsbD0iI2ZmZiIgZD0iTTkyIDc2VjM2YzAtNi42My01LjM3LTEyLTEyLTEySDQwYy02LjYzIDAtMTIgNS4zNy0xMiAxMnY0MGMwIDYuNjMgNS4zNyAxMiAxMiAxMmg0MGM2LjYzIDAgMTItNS4zNyAxMi0xMnptLTUyIDRjLTIuMjEgMC00LTEuNzktNC00VjM2YzAtMi4yMSAxLjc5LTQgNC00aDQwYzIuMjEgMCA0IDEuNzkgNCA0djQwYzAgMi4yMS0xLjc5IDQtNCA0SDQweiIvPjwvc3ZnPg=="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _12Ws_" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC4zNS00LjM1TTggMTFoNiIvPjwvc3ZnPg=="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _2Fw8Z" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGNpcmNsZSBjeD0iMTEiIGN5PSIxMSIgcj0iOCIvPjxwYXRoIGQ9Ik0yMSAyMWwtNC4zNS00LjM1TTExIDh2Nk04IDExaDYiLz48L3N2Zz4="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _3edFG" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI0IiB2ZXJzaW9uPSIxLjIiIHZpZXdCb3g9IjIgMiAyMCAyMCIgd2lkdGg9IjI0IiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjxnIGZpbGw9IiNmZmYiPjxwYXRoIGQ9Ik0xMiA0YTggOCAwIDEwMCAxNiA4IDggMCAwMDAtMTZ6bTAgMTRhNiA2IDAgMTEwLTEyIDYgNiAwIDAxMCAxMnoiLz48cGF0aCBkPSJNMTIgN3YxMGMyLjc1NyAwIDUtMi4yNDMgNS01cy0yLjI0My01LTUtNXoiLz48L2c+PC9zdmc+"); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs fE8zg" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSItMC41IC0wLjUgMjUgMjUiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIxMiIgY3k9IjEyIiByPSIxMCIvPjxwYXRoIGZpbGw9IiNmZmYiIGQ9Ik0xMCA4bDYgNC02IDRWOHoiLz48L3N2Zz4="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div><div class="_48Ihs _37mMZ" style="background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB2aWV3Qm94PSIyIDIgMjAgMjAiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMTggNkw2IDE4TTYgNmwxMiAxMiIvPjwvc3ZnPg=="); background-position: 0px center; background-repeat: no-repeat; background-size: 21px 21px; cursor: pointer; display: inline-block; height: 50px; opacity: 0.5; padding-right: 20px; transition: opacity 0.2s ease-out 0s; vertical-align: middle; white-space: nowrap; width: 30px;"></div></div><div class="_qWfy" style="background-color: rgba(255, 255, 255, 0.45); height: 3px; position: absolute; top: 0px; transform: translateX(-100%); transition: transform 1s linear 0s; width: 1833px;"></div><div class="_3m3Ci _2Ncen" style="background-color: rgba(0, 0, 0, 0.45); background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1IDE4bC02LTYgNi02Ii8+PC9zdmc+"); background-position: 50% center; background-repeat: no-repeat; background-size: 30px 30px; border-radius: 100%; box-sizing: border-box; cursor: pointer; height: 50px; left: 20px; margin-top: -25px; opacity: 0.65; padding: 10px; position: absolute; top: 474px; transform: translateX(-100px); transition: transform 0.35s ease-out 0s, opacity 0.2s ease-out 0s; width: 50px;"></div><div class="_3m3Ci _33r5o" style="background-color: rgba(0, 0, 0, 0.45); background-image: url("data:image/svg+xml;base64,PHN2ZyBmaWxsPSJub25lIiBoZWlnaHQ9IjI0IiBzdHJva2U9IiNmZmYiIHN0cm9rZS1saW5lY2FwPSJyb3VuZCIgc3Ryb2tlLWxpbmVqb2luPSJyb3VuZCIgc3Ryb2tlLXdpZHRoPSIyIiB3aWR0aD0iMjQiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTE1IDE4bC02LTYgNi02Ii8+PC9zdmc+"); background-position: 50% center; background-repeat: no-repeat; background-size: 30px 30px; border-radius: 100%; box-sizing: border-box; cursor: pointer; height: 50px; left: auto; margin-top: -25px; opacity: 0.65; padding: 10px; position: absolute; right: 20px; top: 474px; transform: translateX(100px) scaleX(-1); transition: transform 0.35s ease-out 0s, opacity 0.2s ease-out 0s; width: 50px;"></div><div class="FMmo6" style="background-color: rgba(0, 0, 0, 0.45); bottom: 0px; contain: layout style paint; left: 0px; line-height: 1.35em; padding: 20px 25px; pointer-events: none; position: absolute; right: 0px;"><div class="xrK4d" style="font-size: 20px; padding-bottom: 10px;"></div><div class="undefined"></div></div></div><div class="_2bmqy" style="bottom: 2px; opacity: 0.1; position: fixed; right: 2px; z-index: 999999;"><label class="_10ATy" style="display: inline-block; height: 10px; position: relative; width: 20px;" title="Toggle enabled Zoom photos"><input checked="" id="zps-switch-show" style="height: 0px; opacity: 0; width: 0px;" type="checkbox" /></label></div></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-44179449295410844382023-01-24T08:48:00.005+05:302023-02-02T13:34:19.936+05:30ROS Installation | Robotic Operating System Installation | Noetic<h1 style="text-align: left;"><span style="font-family: courier; font-size: x-large;"><b>ROS Noetic Installation</b></span></h1><div style="text-align: left;"><span style="font-family: courier;">Today we are going to see the installation of </span><span style="font-family: courier;">Robotic Operating System 1 (ROS)</span></div><div style="text-align: left;"><span style="font-family: courier;"><b><br /></b></span></div><h2 style="text-align: left;"><span style="font-family: courier;"><b>Step 1: What We need:</b></span></h2><div style="text-align: left;"><ul style="text-align: left;"><li><span style="font-family: courier;">This will mainly work on Ubuntu 20.04 OS </span></li><li><span style="font-family: courier;">Support till 2025 May.</span></li><li><span style="font-family: courier;">Name of the ROS: Noetic </span></li></ul><div><span style="font-family: courier;">For the complete installation step by step, you can watch the video given below</span></div><div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/v22t0lKgjJA" width="320" youtube-src-id="v22t0lKgjJA"></iframe></div><br /><h2 style="text-align: left;"><span style="font-family: courier;">Step 2: Commands</span></h2></div></div><div style="text-align: left;"><span style="font-family: courier;">Here are the commands to be used one after the other. </span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ sudo apt install curl # if you haven't already installed curl</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">The above commands add the ROS to the aptitude manager and we can now install ROS1 with simple commands</span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ sudo apt update</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ sudo apt install build-essential autoconf automake libxmu-dev</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><b><br /></b></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ sudo apt install ros-noetic-desktop-full</b></span></div><div style="text-align: left;"><span style="font-family: courier;">The above command need 370MB of softwares to be downloaded.</span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">So the complete package of ROS installed. </span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">We need some more packages to be installed that can create our own workspaces and manage our own workspaces, here are the following packages.</span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ sudo rosdep init</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ rosdep update</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><h2 style="text-align: left;"><span style="font-family: courier;">Step 3: Set the path information</span></h2><div style="text-align: left;"><span style="font-family: courier;">Now set the path for a bash file.</span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">Open .bashrc file from the home folder and set the folllwing line</span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">Open the above file using the command </span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ cd </b></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ gedit .bashrc</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">Go to the end of the file and paste the following line</span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>source /opt/ros/noetic/setup.bash</b></span></div><div style="text-align: left;"><br /></div><div style="text-align: left;"><span style="font-family: courier;"><b>This is how it looks</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR6bT0AgOh3XEnqYgMEvQM45lLlrZ04xGrPQmaWtWEIT9rltOiONVHcSr9qdJth_UL3FYWEzu6UkgVUdKfzvPMNq4HI6r8vrcfpXTcaudpIeTjl3rerrR3Mxijqi4INpdn-6dxlQYP5tVB2Xcsgx9Im3_OIHAEtsUtW9QJO5FStY6DGrGe6hXxfEGY/s2880/Screenshot%202023-01-22%20at%209.47.29%20PM.png" style="margin-left: auto; margin-right: auto;"><img alt="ROS1 Noetic" border="0" data-original-height="1800" data-original-width="2880" height="400" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiR6bT0AgOh3XEnqYgMEvQM45lLlrZ04xGrPQmaWtWEIT9rltOiONVHcSr9qdJth_UL3FYWEzu6UkgVUdKfzvPMNq4HI6r8vrcfpXTcaudpIeTjl3rerrR3Mxijqi4INpdn-6dxlQYP5tVB2Xcsgx9Im3_OIHAEtsUtW9QJO5FStY6DGrGe6hXxfEGY/w640-h400/Screenshot%202023-01-22%20at%209.47.29%20PM.png" title="ROS1 Noetic" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">ROS path setting</td></tr></tbody></table><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">and logout and login back... or restart the system.</span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">Thats it... </span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">We have installed ROS1 Noetic successfully in Ubuntu 20.04</span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">To check whether it's working or not... run the following commands. </span></div><div style="text-align: left;"><span style="font-family: courier;"><b><br /></b></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ rosrun</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ roslaunch</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ rosmsgs</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ rqt_graph</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><b>$ rostopic</b></span></div><div style="text-align: left;"><span style="font-family: courier;"><br /></span></div><div style="text-align: left;"><span style="font-family: courier;">If these commands are recognised, then ROS is installed successfully. </span></div><div style="text-align: left;"><br /></div><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-16839890144486870062023-01-09T20:23:00.005+05:302023-01-09T20:23:58.826+05:30Constrained Application Protocol (CoAP) using Node JS<h2 style="text-align: left;"><span style="font-size: x-large;">Constrained Application Protocol using Node JS</span></h2><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 32px;">Constrained application protocol is shortly called as CoAP and its based on Request Response Model where a browser or application will be requesting for a resource from the server. The resource would be a sensor reading like temperature, humidity, heartbeat, etc. </p><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 32px;">For complete explanation of the source code and the demo please go through the video:</p><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/tmHC9zVVTTQ" width="320" youtube-src-id="tmHC9zVVTTQ"></iframe></div><br /><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 32px;">CoAP can be developed with many programming or scripting languages like:</p><ol>
<li style="color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 24px;"><span style="background-color: white;">Python</span></li>
<li style="color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 24px;"><span style="background-color: white;">Node JS</span></li>
<li style="color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 24px;"><span style="background-color: white;">Contiki OS</span></li></ol><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 32px;">In this article, I will be writing or explaining the source code of CoAP using Node JS and this can be demonstrated with a plugin name called Cu Plugin for Chrome Browser. There are many CoAP client available like coap, libcoap, etc in Linux OS and Cu Plugin being a easier and common approach for a client. </p><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 32px;">You can refer the complete</p><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 32px;">This program first starts the CoAP Server and accept only the JSON format headers, else it will throw the error number '4.06'. </p><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 32px;">Based on the request URL (req.url), the incoming requests will be handled by the server and responded with json based sensor values namely: for example, for "temperature", the server respond with {'temperature':988}. The values generated her is baaed on a random integer, in case of real sensor attached to the sensor, it can send those information as well. </p><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-family: Times; font-size: 20px; font-stretch: normal; line-height: normal; margin: 0px 0px 32px;">Here is the source code of the CoAP program. The name of the file is coap.js </p><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-stretch: normal; line-height: normal; margin: 0px 0px 32px;"><span style="font-family: courier; font-size: medium;"><span style="white-space: pre-wrap;">var coap = require('coap');</span></span></p><p style="background-color: white; color: rgba(0, 0, 0, 0.9); font-stretch: normal; line-height: normal; margin: 0px 0px 32px;"><span style="font-family: courier; font-size: large; white-space: pre-wrap;">function randomInt(min,max) {</span></p><pre style="overflow-wrap: break-word; white-space: pre-wrap;"><span style="font-family: courier; font-size: medium;">return (Math.floor(Math.random()*(max-min) + min));
}
var portNumber=5683;
coap.createServer(function (req,res) {
console.info('CoAP device got a request from %s', req.url);
if(req.headers['Accept'] != 'application/json') {
res.code='4.06';
return res.end();
}
switch(req.url) {
case "/co2":
displayOutput(res, {'Co2':randomInt(0,1000)});
break;
case "/temperature":
displayOutput(res, {'Temperature':randomInt(-10,50)});
break;
case "/humidity":
displayOutput(res, {'Humidity':randomInt(0,100)});
break;
default:
displayOutput(res);
}
}).listen(portNumber);
console.log('CoAP Server is started at port Number 5683');
function displayOutput (res,content) {
if(content) {
res.setOption('Content-Format','application/json');
res.code='2.05';
res.end (JSON.stringify(content));
} else {
res.code='4.04';
res.end();
}
}</span></pre><pre style="overflow-wrap: break-word; white-space: pre-wrap;"><span style="font-family: courier; font-size: medium;">//End of Program</span></pre><pre style="overflow-wrap: break-word;"><span style="font-family: courier; font-size: medium;"><span style="white-space: pre-wrap;">To install the packages in Linux, here is the command</span></span></pre><pre style="overflow-wrap: break-word;"><span style="background-color: white; caret-color: rgb(241, 241, 241); font-family: courier; font-size: large; white-space: pre-wrap;">$ sudo apt update
$ sudo apt install nodejs npm
$ npm install coap</span></pre><pre style="overflow-wrap: break-word;"><span style="font-family: courier; font-size: medium;"><span style="white-space: pre-wrap;">The above program can be run using the command </span></span></pre><pre style="overflow-wrap: break-word;"><span style="font-family: courier; font-size: medium;"><span style="white-space: pre-wrap;">$ node coap.js </span></span></pre><pre style="overflow-wrap: break-word;"><span style="font-family: courier; font-size: medium;"><span style="white-space: pre-wrap;">The request are </span></span></pre><pre style="overflow-wrap: break-word;"><span style="background-color: white; caret-color: rgb(241, 241, 241); white-space: pre-wrap;"><span style="font-family: courier; font-size: medium;">coap://localhost:5683/co2
coap://localhost:5683/temperature
coap://localhost:5683/humidity</span></span></pre><pre style="overflow-wrap: break-word;"><span style="background-color: white; caret-color: rgb(241, 241, 241); white-space: pre-wrap;"><span style="font-family: courier; font-size: medium;"><br /></span></span></pre><pre style="overflow-wrap: break-word;"><span style="background-color: white;"><span style="font-family: courier; font-size: medium;"><span style="caret-color: rgb(241, 241, 241); white-space: pre-wrap;">The following will be the output
{'Co2':899}
{'Temperature':45}
{'Humidity':67}</span></span></span></pre><pre style="overflow-wrap: break-word;"><span style="font-family: courier; font-size: medium;"><span style="white-space: pre-wrap;">This will start the server and the client can browse the server through the plugin called Cu plugin in Google Chrome Browser. There is a small work around to do the customisation. Please follow the video for enabling the Cu plugin in Google Chrome browser. </span></span></pre><pre style="overflow-wrap: break-word;"><span style="font-family: courier; font-size: medium;"><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/VWDEwaCdPBQ" width="320" youtube-src-id="VWDEwaCdPBQ"></iframe></div><span style="white-space: pre-wrap;"><br /></span></span></pre><pre style="overflow-wrap: break-word;"><span style="font-family: courier; font-size: medium;"><span style="white-space: pre-wrap;">Here is the output screen shot of the above request.</span></span></pre><pre style="overflow-wrap: break-word;"><span style="font-family: courier; font-size: medium;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKmqHC31Nurpoutb3n8jnd_wEscJTLQdVX7pRKjBIdAfPYTMWZP62-MmYu9nqZHOkA_4B5tj1ph6ovxFe01tEG8OTVV1G0T3AZv2A-BWklRaEReZS-cH3H92FBN0xZsoOwhcDimKnDa9ZjpDnS7DpU3rbCWyFp0aZX9csJoxCns87QxZylOPORaGID/s2682/Screenshot%202023-01-09%20at%208.11.33%20PM.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="CoAP" border="0" data-original-height="1424" data-original-width="2682" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgKmqHC31Nurpoutb3n8jnd_wEscJTLQdVX7pRKjBIdAfPYTMWZP62-MmYu9nqZHOkA_4B5tj1ph6ovxFe01tEG8OTVV1G0T3AZv2A-BWklRaEReZS-cH3H92FBN0xZsoOwhcDimKnDa9ZjpDnS7DpU3rbCWyFp0aZX9csJoxCns87QxZylOPORaGID/w640-h340/Screenshot%202023-01-09%20at%208.11.33%20PM.png" title="CoAP" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">CoAP Client (Cu) plugin</td></tr></tbody></table><br /><span style="white-space: pre-wrap;"><br /></span></span></pre><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-10352484264749165692022-12-27T22:57:00.005+05:302022-12-27T22:57:51.577+05:30Ptolemy II Installation in Ubuntu 22.04<b>Installation of Ptolemy II in Ubuntu 22.04</b><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div><b>This post shows the installation instructions of Ptolemy II in Windows 11 and Ubuntu 22.04 Operating System. </b></div><div><b>Ptolemy II is used to simulate and emulate discrete systems, Synchronous dataflow, dynamic Dataflow, FSM, etc. The software is free and open source and its based on Java. </b></div><div><b><br /></b></div><div><b>The complete instructions can be found in this video </b></div><div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/-ZT4y9aU4Ng" width="320" youtube-src-id="-ZT4y9aU4Ng"></iframe></div><b><br /></b></div><div><b><br /></b></div><div><b>Tools needed:</b></div><div><b>1. JDK is needed (preferably JDK 11, if you have already another version of JDK, no issues you can install JDK 11 as well and you can change the runtime java based on the need. For more details on how to switch the java version in Ubuntu, <a href="https://www.youtube.com/watch?v=wBuhepupNOs" target="_blank">Check this video</a>)</b></div><div><b><br /></b></div><div><b>2. Ptolemy Software (can be downloaded from <a href="https://ptolemy.berkeley.edu/ptolemyII/ptII11.0/ptII11.0.1.src.tar.gz" target="_blank">here</a>) </b></div><div><b><br /></b></div><div><b>Step 1: Getting ready with your Ubuntu 22.04 OS</b></div><div><br /></div><div>Run the following commands </div><div><br /></div><div><span style="font-family: courier;">$ sudo apt update </span></div><div><span style="font-family: courier;">$ sudo apt install openjdk-11-jdk build-essential autoconf automake libxmu-dev</span></div><div><br /></div><div><b>Step 2 - Extract the ptolemy software through the GUI window and set the environmental variable</b></div><div>Right click over the file and click "Extract Here"</div><div>Set the PTII environment as per the following commands.</div><div>Open the terminal and open the file using the command </div><div><br /></div><div><span style="font-family: courier;">$ gedit ~/.bashrc</span></div><div>and copy the following line in the line number 4</div><div><div><br /></div><div><span style="font-family: courier;">export PTII=$HOME/ptII11.0.1.src/ptII11.0.1</span></div></div><div><br /></div><div><b>Step 3: Installation of Ptolemy II </b></div><div>I have installed in my home folder as per this path (/home/pradeepkumar/ptII11.0.1.src/ptII11.0.1/) </div><div><br /></div><div>Open a terminal and execute the following commands </div><div><br /></div><div><span style="font-family: courier;"><b>$ cd ptII11.0.1.src/ptII11.0.1/</b></span></div><div><span style="font-family: courier;"><b>$ ./configure --enable-verbose </b></span></div><div><span style="font-family: courier;"><b>$ make </b></span></div><div><span style="font-family: courier;"><b>$ cd bin </b></span></div><div><span style="font-family: courier;"><b>$ ./vergil </b></span></div><div><br /></div><div>Once the installation over, you can open the vergil software and it shows the screenshot like this.</div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg12x89oaMahVAV60R-jCH5M4ZftqPHtOF1ISucZnhuTCHLDOrNc0rzgNzocjH20hgGOXahplvDnFGn4vopqRqY8-IndCAc95YupBySK_fXRCq_aUGHI9kIuPWU0XlhkzaSyzHYeKtkDT8lPw5yDL6RrH1KcNi_OFfHXdlPjLEzJfOWlVxIR0MIVgF9/s1920/Screenshot%20from%202022-12-27%2022-55-31.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Ptolemy II" border="0" data-original-height="1080" data-original-width="1920" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg12x89oaMahVAV60R-jCH5M4ZftqPHtOF1ISucZnhuTCHLDOrNc0rzgNzocjH20hgGOXahplvDnFGn4vopqRqY8-IndCAc95YupBySK_fXRCq_aUGHI9kIuPWU0XlhkzaSyzHYeKtkDT8lPw5yDL6RrH1KcNi_OFfHXdlPjLEzJfOWlVxIR0MIVgF9/w640-h360/Screenshot%20from%202022-12-27%2022-55-31.png" title="Ptolemy II" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Ptolemy II</td></tr></tbody></table><br /><div><br /></div><div>Then you can proceed to go to the documentation and other examples there of. For more details watch the Youtube video</div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-79222738438872034552022-11-12T15:49:00.006+05:302022-11-12T15:49:57.227+05:30Installing ns-3.37 and ns-3.35 in Ubuntu | Ubuntu 22.04 | NS3<h1 style="text-align: left;"><span style="font-family: courier;">Multiple Versions of ns3 in Ubuntu 22.04</span></h1><div><span style="font-family: courier;">In this post, we are going to install two versions of ns3 namely ns-3.35 and ns-3.37 </span></div><div><span style="font-family: courier;"><br /></span></div><div><b><span style="font-family: courier;">My OS is : Ubuntu 22.04 LTS (Long Term Support)</span></b></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">ns-3.35 uses waf and (./waf --run scratch/first) </span></div><div><span style="font-family: courier;">ns-3.37 uses cmake (./ns3 run scratch/first.cc)</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">So we will install both the packages </span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">Go through the video for complete instructions</span></div><div><span style="font-family: courier;"><br /></span></div><div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/vU4GE2oKao0" width="320" youtube-src-id="vU4GE2oKao0"></iframe></div><br /></div><div><span style="font-family: courier;">To start with </span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ sudo apt update </span></div><div><span style="font-family: courier;">$ sudo apt install build-essential autoconf automake libxmu-dev g++ python3 python3-dev pkg-config sqlite3 cmake python3-setuptools git qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 openmpi-bin openmpi-common openmpi-doc libopenmpi-dev autoconf cvs bzr unrar gsl-bin libgsl-dev libgslcblas0 wireshark tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libc6-dev libc6-dev-i386 libclang-dev llvm-dev automake python3-pip libxml2 libxml2-dev libboost-all-dev </span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">I have downloaded both the versions of ns3 from https://nsnam.org </span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">Copy both the softwares from the Downloads/ folder to the home folder (in my case its /home/pradeepkumar/)</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">My Website is <a href="https://www.nsnam.com " target="_blank">https://www.nsnam.com </a></span></div><div><span style="font-family: courier;">My Github is <a href="https://github.com/tspradeepkumar">https://github.com/tspradeepkumar</a></span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">Please subscribe to my channel now... Also consider joining for membership... </span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">Now extract both the versions using the GUI method.</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">Just right click and click "Extract Here"</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">We will install one by one, First let me try ns-3.37, In case of any errors, we need to correct it as well.</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ cd ns-allinone-3.37/</span></div><div><span style="font-family: courier;">$ ./build.py --enable-examples --enable-tests</span></div><div><span style="font-family: courier;">This process might take a longer time based on your RAM and Processor. I have an M.2 SSD and Intel i5 - 10th Gen processor with 16GB RAM. the installtion should be fast...</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">lets see...</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">ns-3.37 installed succesfully and we have tested an example as well. </span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ ./ns3 run hello-simulator </span></div><div><span style="font-family: courier;">$ ./ns3 run scratch/first.cc </span></div><div><span style="font-family: courier;">The output is shown below in the figure</span></div><div><span style="font-family: courier;"><br /></span></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><img alt="ns3 example" height="142" src="blob:https://draft.blogger.com/caf2186e-fa11-498a-9b73-e326597159af" style="margin-left: auto; margin-right: auto;" title="ns3 example" width="640" /></td></tr><tr><td class="tr-caption" style="text-align: center;">ns3 example</td></tr></tbody></table><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">Now we will install ns-3.35 </span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">$ cd</span></div><div><span style="font-family: courier;">$ cd ns-allinone-3.35/</span></div><div><span style="font-family: courier;">$ ./build.py --enable-examples --enable-tests</span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">In case, if you get the following error</span></div><div><span style="font-family: courier;">pybindgen(ns3 module antenna)</span></div><div><span style="font-family: courier;">Do this step</span></div><div><span style="font-family: courier;">Go to the following URL</span></div><div><span style="font-family: courier;"><a href="https://github.com/gjcarneiro/pybindgen/commit/e645cc684602802580a0b800518c784100d54561">https://github.com/gjcarneiro/pybindgen/commit/e645cc684602802580a0b800518c784100d54561</a></span></div><div><span style="font-family: courier;">and make the changes as given in the video</span></div><div><span style="font-family: courier;"><br /></span></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><img alt="ns3 error" height="454" src="blob:https://draft.blogger.com/38ff466b-3962-4357-b2bf-92a3d243e859" style="margin-left: auto; margin-right: auto;" title="ns3 error" width="640" /></td></tr><tr><td class="tr-caption" style="text-align: center;">ns3 error</td></tr></tbody></table><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">We have installed two version of ns3.37 and ns-3.35 successfully in Ubuntu 22.04 </span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">Thanks for watching.</span></div><div><span style="font-family: courier;">Please subscribe/join our channel for more videos.</span></div><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com1tag:blogger.com,1999:blog-8826608353769320919.post-7299161370597748442022-09-28T20:58:00.002+05:302022-09-28T20:58:39.749+05:30Conikit NG installation in Ubuntu 20.04 <b><span style="font-size: x-large;">Contiki NG Installation</span></b><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script><ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div><b>This post shows the contiki NG installation in Ubuntu 20.04 OS. The same instruction will work for Ubuntu 22.04 as well. </b></div><div><br /></div><div>Requirements:</div><div>OS - Ubuntu 20.04 </div><div>Contiki NG OS - <a href="https://github.com/contiki-ng/contiki-ng " target="_blank">https://github.com/contiki-ng/contiki-ng </a></div><div><br /></div><div><b>Watch the video for complete installation instructions</b></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/p68XHd9kXTQ" width="320" youtube-src-id="p68XHd9kXTQ"></iframe></div><br /><h2 style="text-align: left;"><br /></h2><h2 style="text-align: left;"><b>Step 1 : Install the basics </b></h2><div><b>Login in to Ubuntu and open the terminal. </b></div><div><b>Give the following command and press enter </b></div><div><b><br /></b></div><div><span style="font-family: courier; font-size: medium;"><b>$ </b><span style="background-color: #f9f9f9; color: #030303; white-space: pre-wrap;">sudo apt install build-essential doxygen git curl wireshark python-serial srecord rlwrap autoconf automake libxmu-dev gcc-msp430 default-jdk ant </span></span><span style="color: #030303; font-family: courier; font-size: medium;"><span style="white-space: pre-wrap;">openjdk-11-jdk</span></span></div><div><span face="Roboto, Arial, sans-serif" style="background-color: #f9f9f9; color: #030303; font-size: 13px; white-space: pre-wrap;"><br /></span></div><div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5boY_pU2Qzq9z1J28JluLdw019gySgjtF8btXFC7albaKo29ooUsiDlCvbOi77pimOiEXEccaz6QsoDfkuQJ50kk6ItlV3O5cyZbScX0XqAY0W8Dod-Rz4pF9XruqzimMTNaX60kxxNpSenv04TNZzuanbgehiq_4jRUmLX5aDg0jBf5alqsvvtGP/s1848/contiking1.png" style="margin-left: auto; margin-right: auto;"><img alt="Contiki NG" border="0" data-original-height="1053" data-original-width="1848" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh5boY_pU2Qzq9z1J28JluLdw019gySgjtF8btXFC7albaKo29ooUsiDlCvbOi77pimOiEXEccaz6QsoDfkuQJ50kk6ItlV3O5cyZbScX0XqAY0W8Dod-Rz4pF9XruqzimMTNaX60kxxNpSenv04TNZzuanbgehiq_4jRUmLX5aDg0jBf5alqsvvtGP/w640-h364/contiking1.png" title="Contiki NG" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Contiki NG</td></tr></tbody></table><span face="Roboto, Arial, sans-serif" style="background-color: #f9f9f9; color: #030303; font-size: x-large; white-space: pre-wrap;"><br /></span></div><div><span face="Roboto, Arial, sans-serif" style="background-color: #f9f9f9; color: #030303; font-size: x-large; white-space: pre-wrap;">Step 2: </span><span face="Roboto, Arial, sans-serif" style="background-color: #f9f9f9; color: #030303; font-size: x-large; white-space: pre-wrap;">To install GCC for ARM controller</span></div><div>Download the following file and unzip (decompress) it in the home folder (in my case it is /home/pradeepkumar) </div><div><a href="https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2">https://launchpad.net/gcc-arm-embedded/5.0/5-2015-q4-major/+download/gcc-arm-none-eabi-5_2-2015q4-20151219-linux.tar.bz2</a></div><div><br /></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; font-size: 13px; margin: 0px; padding: 0px; white-space: pre-wrap;">set the above in the PATH Environment.
</span><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">
/home/pradeepkumar/.bashrc</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; font-size: 13px; margin: 0px; padding: 0px; white-space: pre-wrap;">
to open the above file using a terminal
</span><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$] gedit /home/pradeepkumar/.bashrc
export PATH=$PATH:/home/pradeepkumar/gcc-arm-none-eabi-5_2-2015q4-20151219-linux/bin
</span><span face="Roboto, Arial, sans-serif" style="font-size: 13px;"><br /></span></span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-size: large;"><b>Step 3 : Set JAVA_HOME Path</b></span></span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; font-size: 13px; margin: 0px; padding: 0px; white-space: pre-wrap;">Contiki NG Supports JDK 11 or JDK 8, hence we need to set the JAVA 11 as the default Java Compiler to work with Contiki NG. </span></div><div><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; font-size: 13px; margin: 0px; padding: 0px; white-space: pre-wrap;">
To find the location of Java, find here
</span><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$] update-alternatives --config java
Set the Path in to the JAVA_HOME Variable.</span></span></div><div><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">
$] cd
$] gedit /home/pradeepkumar/.bashrc
</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; font-size: 13px; margin: 0px; padding: 0px; white-space: pre-wrap;">
</span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;">export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
</span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; font-size: 13px; margin: 0px; padding: 0px; white-space: pre-wrap;">
</span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-size: large;"><b>Step 4 - Installing CoAP Client
</b></span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; font-size: 13px; margin: 0px; padding: 0px; white-space: pre-wrap;">
</span><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ sudo apt-get install -y npm && sudo apt-get clean && sudo npm install coap-cli -g && sudo ln -s /usr/bin/nodejs /usr/bin/node
</span></span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; font-size: 13px; margin: 0px; padding: 0px; white-space: pre-wrap;">
</span><span class="style-scope yt-formatted-string" dir="auto" face="Roboto, Arial, sans-serif" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-size: large;"><b>Step 5 - Installing MQTT Clients
</b></span></span><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span face="Roboto, Arial, sans-serif" style="font-size: 13px;">
</span><span style="font-family: courier;">$ sudo apt-get install -y mosquitto mosquitto-clients
</span><span face="Roboto, Arial, sans-serif" style="font-size: 13px;">
</span><b style="font-family: Roboto, Arial, sans-serif;"><span style="font-size: large;">Step 6 Download Contiki NG
</span></b><span style="font-family: courier;">$ git clone https://github.com/contiki-ng/contiki-ng.git </span></span></div><div><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background: rgb(249, 249, 249); border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ cd contiki-ng
$ git submodule update --init --recursive</span></span></div><div><span face="Roboto, Arial, sans-serif" style="background-color: #f9f9f9; color: #030303; font-size: 13px; white-space: pre-wrap;"><br /></span></div><div><span face="Roboto, Arial, sans-serif" style="background-color: #f9f9f9; color: #030303; font-size: 13px; white-space: pre-wrap;"><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><b style="font-family: Roboto, Arial, sans-serif;"><span style="font-size: large;">Step 7 To open the cooja Simulator, follow the steps</span></b></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ cd contiki-ng/tools/cooja</span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ ./gradlew run </span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"><br /></span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">An eclipse based editor window opens where you can do the simulation. </span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"><br /></span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">In case to use the compiler in the command line interface, there is a separate procedure </span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"><br /></span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ cd contiki-ng/examples/hello-world</span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"><br /></span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">To compile for native mode use the following method</span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"><br /></span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ make TARGET=native </span></span></div><div style="color: black; font-size: medium; white-space: normal;"><br /></div><div style="color: black; font-size: medium; white-space: normal;">To run the native example </div><div style="color: black; font-size: medium; white-space: normal;"><br /></div><div style="color: black; font-size: medium; white-space: normal;"><span style="font-family: courier;">$ ./hello-world.native </span></div><div style="color: black; font-size: medium; white-space: normal;"><br /></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">To cross compile for the sky mote, use the following command </span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"><br /></span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ make TARGET=sky </span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">To run the sky motes, we need sky motes or else we can use the cooja simulator to emulate the application. </span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"><br /></span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">To cross compile for the sky mote, use the following command </span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;">$ make TARGET=zoul </span></span></div><div style="color: black; font-size: medium; white-space: normal;"><span class="style-scope yt-formatted-string" dir="auto" style="--tw-ring-color: rgba(100, 149, 237, 0.5); --tw-ring-inset: var(--tw-empty, ); --tw-ring-offset-color: #fff; --tw-ring-offset-shadow: 0 0 rgba(0,0,0,0); --tw-ring-offset-width: 0px; --tw-ring-shadow: 0 0 rgba(0,0,0,0); --tw-shadow: 0 0 rgba(0,0,0,0); background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; border: 0px; color: #030303; margin: 0px; padding: 0px; white-space: pre-wrap;"><span style="font-family: courier;"><br /></span></span></div></span></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-62629032255887025862022-06-28T16:44:00.003+05:302022-07-07T10:36:06.640+05:30Installing ns3 in Ubuntu 22.04 | Complete Instructions<div>In this post, we are going to see how to install ns-3.36.1 in Ubuntu 22.04.</div><div><br /></div><div>You can follow the video for complete details</div><h3 style="text-align: left;"><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/3lWeCGPiWWM" width="320" youtube-src-id="3lWeCGPiWWM"></iframe></div><br /><span style="font-size: medium; font-weight: normal;"><br /></span></h3><h3 style="text-align: left;"><span style="font-size: medium; font-weight: normal;">Tools used in this simulation:<br />NS3 version ns-3.36.1 <br />OS Used: Ubuntu 22.04 LTS</span></h3><div><b><span style="font-size: x-large;">Installation of NS3 (ns-3.36.1)</span></b></div><div>There are some changes in the ns3 installation procedure and the dependencies.</div><div><br /></div><div>So open a terminal and issue the following commands</div><h2 style="text-align: left;"><b>Step 1: Prerequisites</b></h2><h3 style="text-align: left;"><span style="font-family: courier;">$ sudo apt update</span></h3><div><br /></div><div>In the following packages, all the required dependencies are taken care and you can install all these packages for the complete use of ns3.</div><div><br /></div><h3 style="text-align: left;"><span style="font-family: courier;">$ sudo apt install g++ python3 python3-dev pkg-config sqlite3 cmake python3-setuptools git qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools gir1.2-goocanvas-2.0 python3-gi python3-gi-cairo python3-pygraphviz gir1.2-gtk-3.0 ipython3 openmpi-bin openmpi-common openmpi-doc libopenmpi-dev autoconf cvs bzr unrar gsl-bin libgsl-dev libgslcblas0 wireshark tcpdump sqlite sqlite3 libsqlite3-dev libxml2 libxml2-dev libc6-dev libc6-dev-i386 libclang-dev llvm-dev automake python3-pip libxml2 libxml2-dev libboost-all-dev </span></h3><div><br /></div><h2 style="text-align: left;"><b>Step 2 : Download ns-allinone-3.36.1.tar.bz2 from the website nsnam.org. </b></h2><div><a href="https://www.nsnam.org/releases/ns-allinone-3.36.1.tar.bz2" target="_blank">https://www.nsnam.org/releases/ns-allinone-3.36.1.tar.bz2 </a></div><div><br /></div><div>Step 3 : Unzip the above file content to the home folder (in my case, its /home/pradeepkumar) - Check your home folder and do it accordingly. </div><div> To unzip use the GUI with Right click and extract and select the /home/pradeepkumar/ folder.</div><div> </div><div> else you can use the command </div><div> </div><div> <span style="font-family: courier;"><b>$ tar jxvf ns-allinone-3.36.1.tar.bz2 </b></span></div><div><span style="font-family: courier;"><b> </b></span></div><div>Step 4: Go to the folder </div><div><span style="font-family: courier;"><b>$ cd ns-allinone-3.36.1/ </b></span></div><div><span style="font-family: courier;"><b><br /></b></span></div><div><span style="font-family: courier;"><b>$ ./build.py --enable-examples --enable-tests</b></span></div><div>This process takes some time depends on the Speed of your system.</div><div><br /></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn0rvudWMy2eiqylD29KpBOI9Kfqd7w3IHVrNleqyabxh_r6VtC3eiGPLMZLmEcr_5O5Fvc5T6IzD_Vpxyl58dI3BYDN3jD6CsHmPiWF6fBWrefVGRPFpYxfaVMuqS19Alqt12ntIfUtBY6RgT3WHweflRfIyljvuvU3b5KR7INpwE0HFXeSoAfjS5/s1920/Screenshot%20from%202022-06-25%2023-41-30.png" style="font-family: courier; margin-left: auto; margin-right: auto; text-align: center;"><img alt="NS3 Installation" border="0" data-original-height="1080" data-original-width="1920" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgn0rvudWMy2eiqylD29KpBOI9Kfqd7w3IHVrNleqyabxh_r6VtC3eiGPLMZLmEcr_5O5Fvc5T6IzD_Vpxyl58dI3BYDN3jD6CsHmPiWF6fBWrefVGRPFpYxfaVMuqS19Alqt12ntIfUtBY6RgT3WHweflRfIyljvuvU3b5KR7INpwE0HFXeSoAfjS5/w640-h360/Screenshot%20from%202022-06-25%2023-41-30.png" title="NS3 Installation" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">NS3 Installation</td></tr></tbody></table><div>Once the installation is done. You can run the example as shown</div><div><br /></div><div><span style="font-family: courier;"><b>$ cd ns-3.36.1/</b></span></div><div><span style="font-family: courier;"><b><br /></b></span></div><div><span style="font-family: courier;"><b>$ ./ns3 run hello-simulator</b></span></div><div><span style="font-family: courier;"><b>Hello Simulator </b></span></div><div><br /></div><div>(You will get this output)</div><div><br /></div><div>To run the examples, we need to copy the examples/tutorial/first.cc to the scratch folder and execute the file as shown below </div><div><br /></div><div><span style="font-family: courier;"><b>To run C++ (.cc) file, the following command is used.</b></span></div><div><span style="font-family: courier;"><b>$ ./ns3 run scratch/first </b></span></div><div><span style="font-family: courier;"><br /></span></div><div><span style="font-family: courier;">To run the python file, here is the command</span></div><div><b><br /></b></div><div><span style="font-family: courier;"><b>$ ./ns3 run scratch/first.py</b></span></div><div><span style="font-family: courier;"><b><br /></b></span></div><div><span style="font-family: courier;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-1PY58na67ZrCGSjhZylzD-jf9tjOaM7kVUYzwKA-K4Lkk4WUpQsD6izszcEC71jcYYM1-heCUcpNlA0vGDFPNsHFgfjuRd0jb-rKIWxEbybGvsmd3cK-kGhJkfE26vowEhCY4bqX8IS8-mrBYRAgQL4E5yZ3PczMuZ9bmxc7lSvGYBqGPBOepusM/s1920/Screenshot%20from%202022-06-26%2012-32-07.png" style="margin-left: auto; margin-right: auto;"><img alt="NS3 Installation" border="0" data-original-height="1080" data-original-width="1920" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi-1PY58na67ZrCGSjhZylzD-jf9tjOaM7kVUYzwKA-K4Lkk4WUpQsD6izszcEC71jcYYM1-heCUcpNlA0vGDFPNsHFgfjuRd0jb-rKIWxEbybGvsmd3cK-kGhJkfE26vowEhCY4bqX8IS8-mrBYRAgQL4E5yZ3PczMuZ9bmxc7lSvGYBqGPBOepusM/w640-h360/Screenshot%20from%202022-06-26%2012-32-07.png" title="NS3 Installation" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="font-family: "Times New Roman"; margin-left: auto; margin-right: auto;"><tbody><tr><td class="tr-caption" style="text-align: center;">NS3 Installation<br /><br /></td></tr></tbody></table></td></tr></tbody></table><div class="separator" style="clear: both; text-align: center;"><span style="text-align: left;"><br /></span></div><div class="separator" style="clear: both; text-align: center;"><span style="text-align: left;">Old system of using WAF is removed and ns3 is the new command....</span></div></span></div><div><br /></div><div><br /></div><div><br /></div><div><br /></div><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0Selaiyur, Chennai, Tamil Nadu, India12.9068283 80.1425180999999910.761092691580348 77.94525247499999 15.052563908419653 82.33978372499999tag:blogger.com,1999:blog-8826608353769320919.post-53528085819682043662022-04-01T15:26:00.002+05:302022-04-01T15:31:16.605+05:30VPL Jail Server Installation | Virtual Programming Laboratory with Moodle<div><b><span style="font-size: x-large;">Virtual Programming Laboratory (VPL) </span></b></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">This post tells you how to install VPL Jail Server Installation in Ubuntu 20.04 and how to configure it using Moodle Learning Management System.</span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: large;">VPL - Virtual Programming Laboratory </span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">For full installation with complete description, follow the video</span></div><div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/Fn6asAqD9G0" width="320" youtube-src-id="Fn6asAqD9G0"></iframe></div><br /><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">What is VPL?</span></div><div><span face="Roboto, Noto, sans-serif" style="background-color: white; color: #0d0d0d; font-size: 15px; white-space: pre-wrap;">VPL is Virtual Programming Laboratory which is a tool for programming assignments, evaluation and running of programs. The programming languages supported by VPL is
C, C++, Java, Python, Perl, PHP, NodeJS, Verilog, etc.</span><span face="Roboto, Noto, sans-serif" style="background-color: white; color: #0d0d0d; font-size: 15px; white-space: pre-wrap;">
</span></div><div><span face="Roboto, Noto, sans-serif" style="background-color: white; color: #0d0d0d; font-size: 15px; white-space: pre-wrap;"><br /></span></div><div><b><span style="font-size: large;">Step 1 - Install </span></b></div><div><span style="font-size: large;">VPN Jail Server Installation </span></div><div><ul style="text-align: left;"><li><span style="font-size: large;">My Server configuration </span></li><li><span style="font-size: medium;">16GB RAM and 16 Core PRocessor (Intel Xeon) </span></li><li><span style="font-size: medium;">Virtual Machine </span></li><li><span style="font-size: medium;">Ubuntu 20.04 (64 bit OS).</span></li></ul></div><div><span style="font-size: large;">To download the softwares </span></div><div><span style="font-family: courier; font-size: medium;"><b>https://vpl.dis.ulpgc.es/index.php/home/download </b></span></div><div><br /></div><div>Unzip or untar the above file in the home folder (in my case it is <span style="font-family: courier;"><b>/home/tspradeepkumar/</b></span>)</div><div><br /></div><div><span style="font-family: courier;"><b>$ cd vpl-jail-system-2.7.2/</b></span></div><div><b style="font-family: courier;">$ sudo ./install-vpl-sh</b></div><div><span style="font-size: medium;"><br /></span></div><div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4gqNG3U1KN6CDudGpUdxns2FxB01XpQN81NiOVpaKTfiEaThcgqgZ3njT41sbTmazyA393I5ye6z4scMWzkozHp-ZUZ3vuW3kX9_GbDXy8supND14bbgBp70eNSZ8cRS6CPEVQsdszj0rXbXgAPd3YRmcTs110PCJsR334W-_IYn1EJGqPLoX__Mp/s1920/Screenshot%20from%202022-04-01%2015-14-42.png" style="margin-left: auto; margin-right: auto;"><img alt="VPL Jail Server Installation" border="0" data-original-height="1080" data-original-width="1920" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg4gqNG3U1KN6CDudGpUdxns2FxB01XpQN81NiOVpaKTfiEaThcgqgZ3njT41sbTmazyA393I5ye6z4scMWzkozHp-ZUZ3vuW3kX9_GbDXy8supND14bbgBp70eNSZ8cRS6CPEVQsdszj0rXbXgAPd3YRmcTs110PCJsR334W-_IYn1EJGqPLoX__Mp/w640-h360/Screenshot%20from%202022-04-01%2015-14-42.png" title="VPL Jail Server Installation" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b>VPL Jail Server Installation</b></td></tr></tbody></table><span style="font-size: large;"><br /></span></div><div><span style="font-size: large;">This will take some time based on your internet connection:</span></div><div><span style="font-size: medium;"><br /></span></div><div><div><span style="font-size: medium;">To Start the VPL Jail Server, use the following command</span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-family: courier; font-size: medium;"><b>$ systemctl start vpl-jail-system</b></span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">To stop it </span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-family: courier; font-size: medium;"><b>$ systemctl stop vpl-jail-system</b></span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">To know the status of the system</span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-family: courier; font-size: medium;"><b>$ systemctl status vpl-jail-system</b></span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">Also open the browser and check the URL </span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-family: courier; font-size: large;"><b>http://172.16.0.91/OK </b></span><span style="font-size: medium;">(Upper Case OK)</span></div><div><span style="font-size: medium;"><br /></span></div><div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0O5R5CF2q4x498ZXamK8QDylQSDYcEkLcQVf_PYwYwbMFbRS7NCGrcFpkDf3C1uIrxqXzE6OAxC5gLaTwgN7mK6meWYQs3XfOnKWemfC5fMGbtJ5x1h0_1oZeVFg6srM4rRzP925CW9-i2VtUx6tF7-RThCiUF3BslIOf1uaYYwMzf9vHhwBa191Q/s1850/Screenshot%20from%202022-04-01%2015-22-19.png" style="margin-left: auto; margin-right: auto;"><img alt="VPL Jail Server Installation" border="0" data-original-height="1055" data-original-width="1850" height="364" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0O5R5CF2q4x498ZXamK8QDylQSDYcEkLcQVf_PYwYwbMFbRS7NCGrcFpkDf3C1uIrxqXzE6OAxC5gLaTwgN7mK6meWYQs3XfOnKWemfC5fMGbtJ5x1h0_1oZeVFg6srM4rRzP925CW9-i2VtUx6tF7-RThCiUF3BslIOf1uaYYwMzf9vHhwBa191Q/w640-h364/Screenshot%20from%202022-04-01%2015-22-19.png" title="VPL Jail Server Installation" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td class="tr-caption" style="text-align: center;"><b>VPL Jail Server Installation</b></td></tr></tbody></table></td></tr></tbody></table><br /><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">You should get a OK indicates that the VPL Jail Server is installed Successfully. </span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">There is a separate configuration for https, you can follow it while installing the VPL jail System.</span></div></div><div><span style="font-size: medium;"><br /></span></div><div><b style="font-size: x-large;">Step 2 - Moodle plugin for VPL software.</b></div><div><br /></div><div><span style="font-size: medium;">Now, how do we enable the plugin in Moodle </span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">Download the plugin from the site</span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-family: courier; font-size: medium;"><b>https://moodle.org/plugins/download.php/24287/mod_vpl_moodle311_2021052513.zip</b></span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-size: medium;">Copy it to the moodle module folder </span></div><div><span style="font-size: medium;"><br /></span></div><div><span style="font-family: courier; font-size: large;"><b>moodle/mod/</b></span></div><div><span style="font-family: courier; font-size: large;"><b><br /></b></span></div><div><span style="font-family: courier; font-size: large;"><b><br /></b></span></div><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-30429137705681104112021-11-18T13:32:00.002+05:302021-11-18T13:32:07.154+05:30Python SSL certificate verify error - Solved<span style="font-size: 20px;">Often we get an error in python in the ssl.c file namely:</span><div><span style="font-size: 20px;"><b><i><br /></i></b></span></div><div><span style="font-size: 20px;"><b><i>ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed:</i></b></span></div><div><span style="font-size: 20px;"><b><i><br /></i></b></span></div><div><span style="font-size: 20px;">The reason is your computer didnt have a valid certificate. There are many options in the internet and none of them worked. Here is the solution: </span></div><div><span style="font-size: 20px;"><br /></span></div><div><div><span style="font-size: 20px;">Download https://letsencrypt.org/certs/lets-encrypt-r3.pem </span></div><div><span style="font-size: 20px;"><br /></span></div><div><span style="font-size: 20px;">rename file .pem to .cer</span></div><div><span style="font-size: 20px;">double click and install</span></div><div><span style="font-size: 20px;">and then try to run app your SSL issue will resolved. Cheers !!!</span></div></div><div><span style="font-size: 20px;"><br /></span></div><div><span style="font-size: 20px;"><br /></span></div><div><span style="font-size: 20px;">Here are the screenshots for the above operations</span></div><div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQM6kNXnKG6szqW_pZWWhMUA7efsMzA00y8bSw74AMWhzoUP8FUEysROjAV5izOfpWQl0vd2uajUGWo2XMamn2axSkH9KwNAD4Wg2vS3cunt3WNaL89HiOq9jrBOd2hnnByPdZuNm2h-U/s682/certi1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="SSL certificate Error" border="0" data-original-height="229" data-original-width="682" height="214" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQM6kNXnKG6szqW_pZWWhMUA7efsMzA00y8bSw74AMWhzoUP8FUEysROjAV5izOfpWQl0vd2uajUGWo2XMamn2axSkH9KwNAD4Wg2vS3cunt3WNaL89HiOq9jrBOd2hnnByPdZuNm2h-U/w640-h214/certi1.png" title="SSL certificate Error" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">SSL certificate Error</td></tr></tbody></table><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGApePjk4ihA_Ay9wtIGuRwAZbOERLLtzjTr6L8ISZDY1uxdh7Is1Znjvr2l1qe4VWgCvZgLxLluuzU-0z5WgFdzSfc7fbx22DybgkSwfUyAec01u_-P-zjFtxlVkc0WsBzhrm1hC4UuQ/s1015/certi2.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="SSL certificate Error" border="0" data-original-height="441" data-original-width="1015" height="278" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGApePjk4ihA_Ay9wtIGuRwAZbOERLLtzjTr6L8ISZDY1uxdh7Is1Znjvr2l1qe4VWgCvZgLxLluuzU-0z5WgFdzSfc7fbx22DybgkSwfUyAec01u_-P-zjFtxlVkc0WsBzhrm1hC4UuQ/w640-h278/certi2.png" title="SSL certificate Error" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">SSL certificate Error</td></tr></tbody></table><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm1rGonwfhUxBl8qp2V2vbzNGI3jCRRu45D6nWFJ_1-R7_6LegqX28brKi3wn8NhB1ZvaXqt3CtW-tmuMXdF_odeyuf1RMwnMFxBkQpFH7Sx84MKidZv_95VZvCYuC56lG2XyrhKzSXYM/s391/certi3.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="SSL certificate Error" border="0" data-original-height="223" data-original-width="391" height="366" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm1rGonwfhUxBl8qp2V2vbzNGI3jCRRu45D6nWFJ_1-R7_6LegqX28brKi3wn8NhB1ZvaXqt3CtW-tmuMXdF_odeyuf1RMwnMFxBkQpFH7Sx84MKidZv_95VZvCYuC56lG2XyrhKzSXYM/w640-h366/certi3.png" title="SSL certificate Error" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">SSL certificate Error</td></tr></tbody></table><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_2A7TS9N97WCUecd4AQAdBaqo5EP6eXAucFWR7mkE45VzpZIKyIDZda5nuO_QRUVcx8YJ276XzmSzbuEzXwV-GT0PRqXaFu_-beIwwwa9mPKB733yzRu_fTT4BNmE_gDbkXlUHufgTIg/s667/certi4.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="SSL certificate Error" border="0" data-original-height="556" data-original-width="667" height="534" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg_2A7TS9N97WCUecd4AQAdBaqo5EP6eXAucFWR7mkE45VzpZIKyIDZda5nuO_QRUVcx8YJ276XzmSzbuEzXwV-GT0PRqXaFu_-beIwwwa9mPKB733yzRu_fTT4BNmE_gDbkXlUHufgTIg/w640-h534/certi4.png" title="SSL certificate Error" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">SSL certificate Error</td></tr></tbody></table><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULLlNYqlA14cUrWbRM44E96vFEN707QXXOz1sQEbF3SCA5HkCLPi8SrerAozmVuz23zqDj1nkN00YkuoWTP5qfeXhZf7StyOKtTJ-IKYwvoixr9ZjSCuCQHy44B5MOddI05fuG1NuLDk/s771/certi5.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="SSL certificate Error" border="0" data-original-height="771" data-original-width="609" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiULLlNYqlA14cUrWbRM44E96vFEN707QXXOz1sQEbF3SCA5HkCLPi8SrerAozmVuz23zqDj1nkN00YkuoWTP5qfeXhZf7StyOKtTJ-IKYwvoixr9ZjSCuCQHy44B5MOddI05fuG1NuLDk/w506-h640/certi5.png" title="SSL certificate Error" width="506" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">SSL certificate Error</td></tr></tbody></table><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2vx3SOSd4KXX35YVk78997lbSLVsIgBUYzu3h2b3NYkk81Ow2ebmyzREczh3OSXkQbANXwo1HUU73b4zHMnKw3ATb2a6fTzgyHQrfR37jCmCS3YesD35bqCan6MQ-yyfJGJL9ND8gbkE/s801/certi6.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="SSL certificate Error" border="0" data-original-height="783" data-original-width="801" height="626" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh2vx3SOSd4KXX35YVk78997lbSLVsIgBUYzu3h2b3NYkk81Ow2ebmyzREczh3OSXkQbANXwo1HUU73b4zHMnKw3ATb2a6fTzgyHQrfR37jCmCS3YesD35bqCan6MQ-yyfJGJL9ND8gbkE/w640-h626/certi6.png" title="SSL certificate Error" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">SSL certificate Error</td></tr></tbody></table><br /><span style="font-size: 20px;"><br /></span></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com1tag:blogger.com,1999:blog-8826608353769320919.post-20976543060961175842021-10-27T15:30:00.001+05:302021-10-27T15:30:28.850+05:30AODV Protocol Modification in NS2 - NS2 Tutorial 7<p class="MsoNormal" style="text-align: left;"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 107%;"><span style="font-size: x-large;">AODV Protocol
Modification</span></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">In this post, you can learn<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="mso-list: l0 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">What is AODV protocol<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="mso-list: l0 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">How to measure the
energy, node position and node speed during AODV transmission<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="mso-list: l0 level1 lfo4; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12.0pt; line-height: 107%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">To understand and
implement the promiscuous mode in AODV<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 107%;"><span style="font-size: large;">Introduction</span><span style="font-size: 12pt;"><o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">A
mobile Adhoc network is self-configurable multi-hop wireless network that will
not depend on pre- existing infrastructure such as access points. A MANET
contains several wireless nodes where each node may move randomly, chose to
communicate with any node in its range directly. In order to communicate with
any node not in its range, intermediate nodes help as routers to forward the
packet to the destination. The characteristics of MANETs are energy
constrained, multi-hop, dynamic topology, no central authority and device
heterogeneity. A node can join any network and can leave the network anytime.
Due to this higher mobility, MANETs exhibit dynamic nature in forming the
topology. Basically, a MANET is self-organized, self-managed decentralized
network with no trusted third parties. Some of the applications where MANET is
showing the competence are military operations, emergency services, commercial
environments, context aware services, linking up the internet and intranet etc
[6]. But lack of central administration, security is a major concern in MANETs
like nodes can behave mischievously, they may be selfish or they try
intercepting the communication. Some of the Attacks on MANETs include gray-hole
attack, black-hole attack, worm-hole attack etc. The routing protocols of the
network layer should address the above stated issues. Several security methods
have been designed for MANETs but most of them need external entity to perform
authentication mechanisms [13]. Many approaches have been proposed to provide
security in MANETs for sensitive information. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify; text-indent: 18.0pt;"><span lang="EN-US" style="font-family: "Times New Roman", serif; font-size: 12pt;">Similarly, many routing protocols on
different trust variants like bandwidth, energy utilized, processing speed, end
to end delay etc are considered in many algorithms. </span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Our approach is to route a packet
to a trusted node via a trusted path using packet forwarding ratio. We are
coupling our trust model to AODV routing protocol of MANETs. The following
sections explain fundamentals in MANETs routing, our trust model and
experimental results.<o:p></o:p></span></p><p class="MsoNormal" style="line-height: normal; text-align: justify; text-indent: 18.0pt;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;"></span></p><div class="separator" style="clear: both; text-align: center;"><br /></div><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid3F_oMmOPeC-xuBYBcxtAFAQK5GTtptGW7n0OcUwMhDbFDMx3KlNU8aR44FVLukpVA6eFVt44JP4-OSKuO4QB5IqpD2KkyKZd_15DB4aoS9u8SqdOYCnVVjC9AkinN-tKDm_4yXjeau0/s412/Clipboard01.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="MANET Protocols" border="0" data-original-height="235" data-original-width="412" height="366" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid3F_oMmOPeC-xuBYBcxtAFAQK5GTtptGW7n0OcUwMhDbFDMx3KlNU8aR44FVLukpVA6eFVt44JP4-OSKuO4QB5IqpD2KkyKZd_15DB4aoS9u8SqdOYCnVVjC9AkinN-tKDm_4yXjeau0/w640-h366/Clipboard01.jpg" title="MANET Protocols" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">MANET Protocols</td></tr></tbody></table><br /><p></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span style="font-family: "Times New Roman", serif; font-size: 12pt;">Routing
protocols in MANETs can be classified into reactive, proactive and hybrid
protocols [2]. Proactive routing protocols are table-driven and in contrary
reactive protocols are on demand, routing information is updated only when
needed. Hybrid approach is a mix of both versions [9]. The following figure
lists out the classification.</span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><!--[if gte vml 1]><v:shapetype
id="_x0000_t32" coordsize="21600,21600" o:spt="32" o:oned="t" path="m,l21600,21600e"
filled="f">
<v:path arrowok="t" fillok="f" o:connecttype="none"/>
<o:lock v:ext="edit" shapetype="t"/>
</v:shapetype><v:shape id="Straight_x0020_Arrow_x0020_Connector_x0020_13"
o:spid="_x0000_s1037" type="#_x0000_t32" style='position:absolute;left:0;
text-align:left;margin-left:123.75pt;margin-top:17.5pt;width:49.5pt;height:23.25pt;
z-index:251668480;visibility:visible;mso-wrap-style:square;
mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;
mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;
mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;
mso-position-horizontal-relative:text;mso-position-vertical:absolute;
mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;
mso-width-relative:page;mso-height-relative:page' o:gfxdata="UEsDBBQABgAIAAAAIQC75UiUBQEAAB4CAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKSRvU7DMBSF
dyTewfKKEqcMCKEmHfgZgaE8wMW+SSwc27JvS/v23KTJgkoXFsu+P+c7Ol5vDoMTe0zZBl/LVVlJ
gV4HY31Xy4/tS3EvRSbwBlzwWMsjZrlprq/W22PELHjb51r2RPFBqax7HCCXIaLnThvSAMTP1KkI
+gs6VLdVdad08ISeCho1ZLN+whZ2jsTzgcsnJwldluLxNDiyagkxOquB2Knae/OLUsyEkjenmdzb
mG/YhlRnCWPnb8C898bRJGtQvEOiVxjYhtLOxs8AySiT4JuDystlVV4WPeM6tK3VaILeDZxIOSsu
ti/jidNGNZ3/J08yC1dNv9v8AAAA//8DAFBLAwQUAAYACAAAACEArTA/8cEAAAAyAQAACwAAAF9y
ZWxzLy5yZWxzhI/NCsIwEITvgu8Q9m7TehCRpr2I4FX0AdZk2wbbJGTj39ubi6AgeJtl2G9m6vYx
jeJGka13CqqiBEFOe2Ndr+B03C3WIDihMzh6RwqexNA281l9oBFTfuLBBhaZ4ljBkFLYSMl6oAm5
8IFcdjofJ0z5jL0MqC/Yk1yW5UrGTwY0X0yxNwri3lQgjs+Qk/+zfddZTVuvrxO59CNCmoj3vCwj
MfaUFOjRhrPHaN4Wv0VV5OYgm1p+LW1eAAAA//8DAFBLAwQUAAYACAAAACEAh/hHbUcCAAD4BAAA
HwAAAGNsaXBib2FyZC9kcmF3aW5ncy9kcmF3aW5nMS54bWysVNtu2zAMfR+wfxD0nvoSx02NOkXh
JH3ptgLpPoCVFVuYLBmS6qQY9u+jfEnTDtiAbX4xJZGHh0cUr2+OjSQdN1ZoldPoIqSEK6ZLoaqc
fn3czpaUWAeqBKkVz+kLt/Rm9fHDNWSVgbYWjCCCshnktHauzYLAspo3YC90yxWe7bVpwOHSVEFp
4IDIjQziMEyDBoSiq1eoNTggz0b8BZTU7BsvC1AdWISULDvfGTlK9u/IkKnuzrS79sF45uxz92CI
KHOKyiloUCIajAejGy6Dd1HVK8Bxbxrvr/d7csxpnCzTMF5Q8pLT5Txepmk44PGjIwwdUtxbYC6G
DvHVIr5cjPnqL39AYPXmtxhIciCDxhlBdlS71jNUXeHN93VH86nwnTMgqtqRW2P0gRRaKc6cNgRd
Jk3OITzaPd6bJUoXNaiK72po+eNLiypGPgSZoMCnmF7G0woyi2TI0+GTLjEAnp3um+n/KHpSA7LW
WHfHdUO8kVM7lnmqL+rTQndv3cB5CuhV01shZV++VOSQU7yzRR9gtRSlP/Ru1lRPhTSkA4mt1H+j
AG/cjH5WZQ9Wcyg3o+1ASLSJ65VzRqCWklOfreElJZLj2/bWQE8qnxEbCgmP1vDqvl+FV5vlZpnM
kjjdzJJwvZ7dbotklm6jy8V6vi6KdfTDk4+SrBZlyZXnP02AKPnleTWCGW313l0w3QTY44LxaQrg
DIjC1xmgJqGCt+h9FyDZ6d+Txtvxlz90yNCgwbs335+NM8oPlvP16icAAAD//wMAUEsDBBQABgAI
AAAAIQC2OwQiVAYAAAsaAAAaAAAAY2xpcGJvYXJkL3RoZW1lL3RoZW1lMS54bWzsWUtvGzcQvhfo
f1jsvbHeio3Iga1H3MZOgkhJkSOlpXYZc5cLkrKjW5EcCxQomhY9NEBvPRRtAyRAL+mvcZuiTYH8
hQ65D5ESVTtGChhBLMDYnf1mOJyZ/YbkXrn6IKbeEeaCsKTjVy9VfA8nExaQJOz4d0aDjy77npAo
CRBlCe74cyz8q9sffnAFbU0oSccM8WAU4Rh7YCgRW6jjR1KmWxsbYgJiJC6xFCfwbMp4jCTc8nAj
4OgYBojpRq1SaW3EiCT+NliUylCfwr9ECiWYUD5UZrCXoBhGvzmdkgnW2OCwqhBiLrqUe0eIdnyw
GbDjEX4gfY8iIeFBx6/oP39j+8oG2sqVqFyja+gN9F+ulysEhzU9Jg/H5aCNRrPR2intawCVq7h+
u9/qt0p7GoAmE5hp5otps7m7udtr5lgDlF06bPfavXrVwhv26ys+7zTVz8JrUGa/sYIfDLoQRQuv
QRm+uYJvNNq1bsPCa1CGb63g25WdXqNt4TUooiQ5XEFXmq16t5htCZkyuueEbzYbg3YtN75AQTWU
1aWGmLJErqu1GN1nfAAABaRIksST8xRP0QRqsosoGXPi7ZMwgsJLUcIEiCu1yqBSh//q19BXOiJo
CyNDW/kFnogVkfLHExNOUtnxPwGrvgF5/eKn1y+eeScPn588/PXk0aOTh79khiytPZSEptarH778
58ln3t/Pvn/1+Gs3Xpj4P37+/PffvnIDYaaLELz85umfz5++/PaLv3587IDvcDQ24SMSY+HdwMfe
bRbDxHQIbM/xmL+ZxihCxNTYSUKBEqRGcdjvy8hC35gjihy4XWxH8C4HinEBr83uWw4PIz6TxGHx
ehRbwAPG6C7jzihcV2MZYR7NktA9OJ+ZuNsIHbnG7qLEym9/lgK3EpfJboQtN29RlEgU4gRLTz1j
hxg7ZnePECuuB2TCmWBT6d0j3i4izpCMyNiqpoXSHokhL3OXg5BvKzYHd71dRl2z7uEjGwlvBaIO
50eYWmG8hmYSxS6TIxRTM+D7SEYuJ4dzPjFxfSEh0yGmzOsHWAiXzk0O8zWSfh3oxZ32AzqPbSSX
5NBlcx8xZiJ77LAboTh1YYckiUzsx+IQShR5t5h0wQ+Y/Yaoe8gDStam+y7BVrpPZ4M7wKymS4sC
UU9m3JHLa5hZ9Tuc0ynCmmqA+C0+j0lyKrkv0Xrz/6V1INKX3z1xzOqiEvoOJ843am+Jxtfhlsm7
y3hALj5399AsuYXhdVltYO+p+z11++88da97n98+YS84GuhbLRWzpbpeuMdr1+1TQulQzineF3rp
LqAzBQMQKj29P8XlPi6N4FK9yTCAhQs50joeZ/JTIqNhhFJY31d9ZSQUuelQeCkTsOzXYqdthaez
+IAF2Xa1WlVb04w8BJILeaVZymGrITN0q73YgpXmtbeh3ioXDijdN3HCGMx2ou5wol0IVZD0xhyC
5nBCz+yteLHp8OKyMl+kasULcK3MCiydPFhwdfxmA1RACXZUiOJA5SlLdZFdncy3mel1wbQqANYR
RQUsMr2pfF07PTW7rNTOkGnLCaPcbCd0ZHQPExEKcF6dSnoWN94015uLlFruqVDo8aC0Fm60L/+X
F+fNNegtcwNNTKagiXfc8Vv1JpTMBKUdfwrbfriMU6gdoZa8iIZwYDaRPHvhz8MsKReyh0SUBVyT
TsYGMZGYe5TEHV9Nv0wDTTSHaN+qNSCEC+vcJtDKRXMOkm4nGU+neCLNtBsSFensFhg+4wrnU61+
frDSZDNI9zAKjr0xnfHbCEqs2a6qAAZEwOlPNYtmQOA4sySyRf0tNaacds3zRF1DmRzRNEJ5RzHJ
PINrKi/d0XdlDIy7fM4QUCMkeSMch6rBmkG1umnZNTIf1nbd05VU5AzSXPRMi1VU13SzmDVC0QaW
Ynm+Jm94VYQYOM3s8Bl1L1PuZsF1S+uEsktAwMv4ObruGRqC4dpiMMs15fEqDSvOzqV27ygmeIpr
Z2kSBuu3CrNLcSt7hHM4EJ6r84PectWCaFqsK3WkXZ8mDlDqjcNqx4fPA3A+8QCu4AODD7KaktWU
DK7gqwG0i+yov+PnF4UEnmeSElMvJPUC0ygkjULSLCTNQtIqJC3f02fi8B1GHYf7XnHkDT0sPyLP
1xb295vtfwEAAP//AwBQSwMEFAAGAAgAAAAhAJxmRkG7AAAAJAEAACoAAABjbGlwYm9hcmQvZHJh
d2luZ3MvX3JlbHMvZHJhd2luZzEueG1sLnJlbHOEj80KwjAQhO+C7xD2btJ6EJEmvYjQq9QHCMk2
LTY/JFHs2xvoRUHwsjCz7DezTfuyM3liTJN3HGpaAUGnvJ6c4XDrL7sjkJSl03L2DjksmKAV201z
xVnmcpTGKSRSKC5xGHMOJ8aSGtHKRH1AVzaDj1bmIqNhQaq7NMj2VXVg8ZMB4otJOs0hdroG0i+h
JP9n+2GYFJ69elh0+UcEy6UXFqCMBjMHSldnnTUtXYGJhn39Jt4AAAD//wMAUEsBAi0AFAAGAAgA
AAAhALvlSJQFAQAAHgIAABMAAAAAAAAAAAAAAAAAAAAAAFtDb250ZW50X1R5cGVzXS54bWxQSwEC
LQAUAAYACAAAACEArTA/8cEAAAAyAQAACwAAAAAAAAAAAAAAAAA2AQAAX3JlbHMvLnJlbHNQSwEC
LQAUAAYACAAAACEAh/hHbUcCAAD4BAAAHwAAAAAAAAAAAAAAAAAgAgAAY2xpcGJvYXJkL2RyYXdp
bmdzL2RyYXdpbmcxLnhtbFBLAQItABQABgAIAAAAIQC2OwQiVAYAAAsaAAAaAAAAAAAAAAAAAAAA
AKQEAABjbGlwYm9hcmQvdGhlbWUvdGhlbWUxLnhtbFBLAQItABQABgAIAAAAIQCcZkZBuwAAACQB
AAAqAAAAAAAAAAAAAAAAADALAABjbGlwYm9hcmQvZHJhd2luZ3MvX3JlbHMvZHJhd2luZzEueG1s
LnJlbHNQSwUGAAAAAAUABQBnAQAAMwwAAAAA
">
<v:stroke endarrow="block"/>
</v:shape><![endif]--><!--[if !vml]--><span style="height: 55px; left: 0px; margin-left: 256px; margin-top: 499px; mso-ignore: vglayout; position: absolute; width: 106px; z-index: 251668480;"><br /></span><!--[endif]--><!--[if gte vml 1]><v:shape
id="Straight_x0020_Arrow_x0020_Connector_x0020_12" o:spid="_x0000_s1036"
type="#_x0000_t32" style='position:absolute;left:0;text-align:left;
margin-left:111pt;margin-top:17.5pt;width:0;height:24.75pt;z-index:251667456;
visibility:visible;mso-wrap-style:square;mso-width-percent:0;
mso-height-percent:0;mso-wrap-distance-left:9pt;mso-wrap-distance-top:0;
mso-wrap-distance-right:9pt;mso-wrap-distance-bottom:0;
mso-position-horizontal:absolute;mso-position-horizontal-relative:text;
mso-position-vertical:absolute;mso-position-vertical-relative:text;
mso-width-percent:0;mso-height-percent:0;mso-width-relative:page;
mso-height-relative:page' o:gfxdata="UEsDBBQABgAIAAAAIQC75UiUBQEAAB4CAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKSRvU7DMBSF
dyTewfKKEqcMCKEmHfgZgaE8wMW+SSwc27JvS/v23KTJgkoXFsu+P+c7Ol5vDoMTe0zZBl/LVVlJ
gV4HY31Xy4/tS3EvRSbwBlzwWMsjZrlprq/W22PELHjb51r2RPFBqax7HCCXIaLnThvSAMTP1KkI
+gs6VLdVdad08ISeCho1ZLN+whZ2jsTzgcsnJwldluLxNDiyagkxOquB2Knae/OLUsyEkjenmdzb
mG/YhlRnCWPnb8C898bRJGtQvEOiVxjYhtLOxs8AySiT4JuDystlVV4WPeM6tK3VaILeDZxIOSsu
ti/jidNGNZ3/J08yC1dNv9v8AAAA//8DAFBLAwQUAAYACAAAACEArTA/8cEAAAAyAQAACwAAAF9y
ZWxzLy5yZWxzhI/NCsIwEITvgu8Q9m7TehCRpr2I4FX0AdZk2wbbJGTj39ubi6AgeJtl2G9m6vYx
jeJGka13CqqiBEFOe2Ndr+B03C3WIDihMzh6RwqexNA281l9oBFTfuLBBhaZ4ljBkFLYSMl6oAm5
8IFcdjofJ0z5jL0MqC/Yk1yW5UrGTwY0X0yxNwri3lQgjs+Qk/+zfddZTVuvrxO59CNCmoj3vCwj
MfaUFOjRhrPHaN4Wv0VV5OYgm1p+LW1eAAAA//8DAFBLAwQUAAYACAAAACEAfs0kGkECAADHBAAA
HwAAAGNsaXBib2FyZC9kcmF3aW5ncy9kcmF3aW5nMS54bWykVE2P2jAQvVfqf7B8h3wQKEQbVqsA
e9m2K7H9AV7HJFYdO7JNAFX97x07CbCUU5tDMrZn3rx5nsnD47EWqGXacCUzHI1DjJikquCyzPCP
t81ojpGxRBZEKMkyfGIGPy4/f3ogaalJU3GKAEGalGS4srZJg8DQitXEjFXDJJztlK6JhaUug0KT
AyDXIojDcBbUhEu8vECtiCVor/k/QAlFf7IiJ7IlBiAFTa93eo6C/j8ySWX7rJtt86odc/qtfdWI
FxkG5SSpQSIc9Ae9GyyDm6jyAnDc6dr5q90OHT3Kyb09BjtaRLtNetml1fc7vrRa3/GGxF0CMK6S
0qPcNi6rbHNn3tYSxUMxW6sJLyuLnrRWB5QrKRm1SiNwGeq8hnBoL3AXBkmVV0SWbFuRhr2dGlAm
ciHABEQ7x3hpziuSGiCD3g9fVQEBZG+Vb5AbleJJnEQhKA6qzCfxfDa7r9gkSibxtM86YDTa2Gem
auSMDJu+wnNpkc9I2hdjO7pDgBdMbbgQvnIh0SHDiykkcCdGCV64Q7/Q5XsuNGqJgNv0T8/ig5tW
e1l4sIqRYt3blnABNrJeNKs5yCgYdtlqVmAkGIyqszp6QrqM0CtAuLe6Ifq1CBfr+XqejJJ4th4l
4Wo1etrkyWi2ib5MV5NVnq+i3458lKQVLwomHf9hoKPkr2mpOdXKqJ0dU1UH0LKcsmGoYaSj8DLS
chAq+IjuGwDIDl9PGprA3XvXHF1vBjcj7M/6X477T1yvl38AAAD//wMAUEsDBBQABgAIAAAAIQC2
OwQiVAYAAAsaAAAaAAAAY2xpcGJvYXJkL3RoZW1lL3RoZW1lMS54bWzsWUtvGzcQvhfof1jsvbHe
io3Iga1H3MZOgkhJkSOlpXYZc5cLkrKjW5EcCxQomhY9NEBvPRRtAyRAL+mvcZuiTYH8hQ65D5ES
VTtGChhBLMDYnf1mOJyZ/YbkXrn6IKbeEeaCsKTjVy9VfA8nExaQJOz4d0aDjy77npAoCRBlCe74
cyz8q9sffnAFbU0oSccM8WAU4Rh7YCgRW6jjR1KmWxsbYgJiJC6xFCfwbMp4jCTc8nAj4OgYBojp
Rq1SaW3EiCT+NliUylCfwr9ECiWYUD5UZrCXoBhGvzmdkgnW2OCwqhBiLrqUe0eIdnywGbDjEX4g
fY8iIeFBx6/oP39j+8oG2sqVqFyja+gN9F+ulysEhzU9Jg/H5aCNRrPR2intawCVq7h+u9/qt0p7
GoAmE5hp5otps7m7udtr5lgDlF06bPfavXrVwhv26ys+7zTVz8JrUGa/sYIfDLoQRQuvQRm+uYJv
NNq1bsPCa1CGb63g25WdXqNt4TUooiQ5XEFXmq16t5htCZkyuueEbzYbg3YtN75AQTWU1aWGmLJE
rqu1GN1nfAAABaRIksST8xRP0QRqsosoGXPi7ZMwgsJLUcIEiCu1yqBSh//q19BXOiJoCyNDW/kF
nogVkfLHExNOUtnxPwGrvgF5/eKn1y+eeScPn588/PXk0aOTh79khiytPZSEptarH77858ln3t/P
vn/1+Gs3Xpj4P37+/PffvnIDYaaLELz85umfz5++/PaLv3587IDvcDQ24SMSY+HdwMfebRbDxHQI
bM/xmL+ZxihCxNTYSUKBEqRGcdjvy8hC35gjihy4XWxH8C4HinEBr83uWw4PIz6TxGHxehRbwAPG
6C7jzihcV2MZYR7NktA9OJ+ZuNsIHbnG7qLEym9/lgK3EpfJboQtN29RlEgU4gRLTz1jhxg7ZneP
ECuuB2TCmWBT6d0j3i4izpCMyNiqpoXSHokhL3OXg5BvKzYHd71dRl2z7uEjGwlvBaIO50eYWmG8
hmYSxS6TIxRTM+D7SEYuJ4dzPjFxfSEh0yGmzOsHWAiXzk0O8zWSfh3oxZ32AzqPbSSX5NBlcx8x
ZiJ77LAboTh1YYckiUzsx+IQShR5t5h0wQ+Y/Yaoe8gDStam+y7BVrpPZ4M7wKymS4sCUU9m3JHL
a5hZ9Tuc0ynCmmqA+C0+j0lyKrkv0Xrz/6V1INKX3z1xzOqiEvoOJ843am+Jxtfhlsm7y3hALj53
99AsuYXhdVltYO+p+z11++88da97n98+YS84GuhbLRWzpbpeuMdr1+1TQulQzineF3rpLqAzBQMQ
Kj29P8XlPi6N4FK9yTCAhQs50joeZ/JTIqNhhFJY31d9ZSQUuelQeCkTsOzXYqdthaez+IAF2Xa1
WlVb04w8BJILeaVZymGrITN0q73YgpXmtbeh3ioXDijdN3HCGMx2ou5wol0IVZD0xhyC5nBCz+yt
eLHp8OKyMl+kasULcK3MCiydPFhwdfxmA1RACXZUiOJA5SlLdZFdncy3mel1wbQqANYRRQUsMr2p
fF07PTW7rNTOkGnLCaPcbCd0ZHQPExEKcF6dSnoWN94015uLlFruqVDo8aC0Fm60L/+XF+fNNegt
cwNNTKagiXfc8Vv1JpTMBKUdfwrbfriMU6gdoZa8iIZwYDaRPHvhz8MsKReyh0SUBVyTTsYGMZGY
e5TEHV9Nv0wDTTSHaN+qNSCEC+vcJtDKRXMOkm4nGU+neCLNtBsSFensFhg+4wrnU61+frDSZDNI
9zAKjr0xnfHbCEqs2a6qAAZEwOlPNYtmQOA4sySyRf0tNaacds3zRF1DmRzRNEJ5RzHJPINrKi/d
0XdlDIy7fM4QUCMkeSMch6rBmkG1umnZNTIf1nbd05VU5AzSXPRMi1VU13SzmDVC0QaWYnm+Jm94
VYQYOM3s8Bl1L1PuZsF1S+uEsktAwMv4ObruGRqC4dpiMMs15fEqDSvOzqV27ygmeIprZ2kSBuu3
CrNLcSt7hHM4EJ6r84PectWCaFqsK3WkXZ8mDlDqjcNqx4fPA3A+8QCu4AODD7KaktWUDK7gqwG0
i+yov+PnF4UEnmeSElMvJPUC0ygkjULSLCTNQtIqJC3f02fi8B1GHYf7XnHkDT0sPyLP1xb295vt
fwEAAP//AwBQSwMEFAAGAAgAAAAhAJxmRkG7AAAAJAEAACoAAABjbGlwYm9hcmQvZHJhd2luZ3Mv
X3JlbHMvZHJhd2luZzEueG1sLnJlbHOEj80KwjAQhO+C7xD2btJ6EJEmvYjQq9QHCMk2LTY/JFHs
2xvoRUHwsjCz7DezTfuyM3liTJN3HGpaAUGnvJ6c4XDrL7sjkJSl03L2DjksmKAV201zxVnmcpTG
KSRSKC5xGHMOJ8aSGtHKRH1AVzaDj1bmIqNhQaq7NMj2VXVg8ZMB4otJOs0hdroG0i+hJP9n+2GY
FJ69elh0+UcEy6UXFqCMBjMHSldnnTUtXYGJhn39Jt4AAAD//wMAUEsBAi0AFAAGAAgAAAAhALvl
SJQFAQAAHgIAABMAAAAAAAAAAAAAAAAAAAAAAFtDb250ZW50X1R5cGVzXS54bWxQSwECLQAUAAYA
CAAAACEArTA/8cEAAAAyAQAACwAAAAAAAAAAAAAAAAA2AQAAX3JlbHMvLnJlbHNQSwECLQAUAAYA
CAAAACEAfs0kGkECAADHBAAAHwAAAAAAAAAAAAAAAAAgAgAAY2xpcGJvYXJkL2RyYXdpbmdzL2Ry
YXdpbmcxLnhtbFBLAQItABQABgAIAAAAIQC2OwQiVAYAAAsaAAAaAAAAAAAAAAAAAAAAAJ4EAABj
bGlwYm9hcmQvdGhlbWUvdGhlbWUxLnhtbFBLAQItABQABgAIAAAAIQCcZkZBuwAAACQBAAAqAAAA
AAAAAAAAAAAAACoLAABjbGlwYm9hcmQvZHJhd2luZ3MvX3JlbHMvZHJhd2luZzEueG1sLnJlbHNQ
SwUGAAAAAAUABQBnAQAALQwAAAAA
">
<v:stroke endarrow="block"/>
</v:shape><![endif]--><!--[if !vml]--><span style="height: 53px; left: 0px; margin-left: 224px; margin-top: 499px; mso-ignore: vglayout; position: absolute; width: 16px; z-index: 251667456;"><br /></span><!--[endif]--><!--[if gte vml 1]><v:shape
id="Straight_x0020_Arrow_x0020_Connector_x0020_11" o:spid="_x0000_s1035"
type="#_x0000_t32" style='position:absolute;left:0;text-align:left;
margin-left:48pt;margin-top:17.5pt;width:51.75pt;height:23.25pt;flip:x;
z-index:251666432;visibility:visible;mso-wrap-style:square;
mso-width-percent:0;mso-height-percent:0;mso-wrap-distance-left:9pt;
mso-wrap-distance-top:0;mso-wrap-distance-right:9pt;
mso-wrap-distance-bottom:0;mso-position-horizontal:absolute;
mso-position-horizontal-relative:text;mso-position-vertical:absolute;
mso-position-vertical-relative:text;mso-width-percent:0;mso-height-percent:0;
mso-width-relative:page;mso-height-relative:page' o:gfxdata="UEsDBBQABgAIAAAAIQC75UiUBQEAAB4CAAATAAAAW0NvbnRlbnRfVHlwZXNdLnhtbKSRvU7DMBSF
dyTewfKKEqcMCKEmHfgZgaE8wMW+SSwc27JvS/v23KTJgkoXFsu+P+c7Ol5vDoMTe0zZBl/LVVlJ
gV4HY31Xy4/tS3EvRSbwBlzwWMsjZrlprq/W22PELHjb51r2RPFBqax7HCCXIaLnThvSAMTP1KkI
+gs6VLdVdad08ISeCho1ZLN+whZ2jsTzgcsnJwldluLxNDiyagkxOquB2Knae/OLUsyEkjenmdzb
mG/YhlRnCWPnb8C898bRJGtQvEOiVxjYhtLOxs8AySiT4JuDystlVV4WPeM6tK3VaILeDZxIOSsu
ti/jidNGNZ3/J08yC1dNv9v8AAAA//8DAFBLAwQUAAYACAAAACEArTA/8cEAAAAyAQAACwAAAF9y
ZWxzLy5yZWxzhI/NCsIwEITvgu8Q9m7TehCRpr2I4FX0AdZk2wbbJGTj39ubi6AgeJtl2G9m6vYx
jeJGka13CqqiBEFOe2Ndr+B03C3WIDihMzh6RwqexNA281l9oBFTfuLBBhaZ4ljBkFLYSMl6oAm5
8IFcdjofJ0z5jL0MqC/Yk1yW5UrGTwY0X0yxNwri3lQgjs+Qk/+zfddZTVuvrxO59CNCmoj3vCwj
MfaUFOjRhrPHaN4Wv0VV5OYgm1p+LW1eAAAA//8DAFBLAwQUAAYACAAAACEADCHb6k8CAAACBQAA
HwAAAGNsaXBib2FyZC9kcmF3aW5ncy9kcmF3aW5nMS54bWykVNtu2zAMfR+wfxD0nvpSO02NukXh
JN1D1xVI9wGqLNvCZMmQFCfBsH8fJdtpmgEbsOYllEUeHh5SvLnbtwL1TBuuZI6jixAjJqkquaxz
/P1lPVtgZCyRJRFKshwfmMF3t58/3ZCs1qRrOEWAIE1GctxY22VBYGjDWmIuVMck3FVKt8TCUddB
qckOkFsRxGE4D1rCJb59g1oSS9BW8/+AEor+YGVBZE8MQAqanX4ZOQr6cWSSyf5Bd5vuWTvm9Kl/
1oiXOQblJGlBIhyMF6MbHIOzqPoNYF/p1vmrqkJ76EAaJ2EIWIccLy7jxXweDnhsbxEFh3l6Fccp
RhQc4us0vkrHfM23fyDQZvVXDCA5kAHjhCDdy03nGMq+cOZ53VE0Fb6xmvC6sehea7VDhZKSUas0
ApdJk1MIh/YIfTNIqqIhsmabhnTs5dCBij4EmIDAxxgv4/FEMgNk0OvuqyohgGyt8sPkikCV4N0X
h/JxbY+6kKzTxj4w1SJn5NiMBR8rHdKR/tHYoetTgNdPrbkQXggh0S7H0L3U8zNK8NJdOjej69dC
aNQTAUPlf049YPHOTautLD1Yw0i5Gm1LuAAbWa+h1RxUFQy7bC0rMRIMXrmzBkQhXUYYLSA8WsP7
+3kdXq8Wq0UyS+L5apaEy+Xsfl0ks/k6ukqXl8uiWEa/HPkoyRpelkw6/tMuiJI/HlrLqVZGVfaC
qjaAaeeUTfsAtkEUvm0DOQkVvEf3IgDZ6d+Tdrr4mQSDDqManL1+7z9uK7diTs+3vwEAAP//AwBQ
SwMEFAAGAAgAAAAhALY7BCJUBgAACxoAABoAAABjbGlwYm9hcmQvdGhlbWUvdGhlbWUxLnhtbOxZ
S28bNxC+F+h/WOy9sd6KjciBrUfcxk6CSEmRI6WldhlzlwuSsqNbkRwLFCiaFj00QG89FG0DJEAv
6a9xm6JNgfyFDrkPkRJVO0YKGEEswNid/WY4nJn9huReufogpt4R5oKwpONXL1V8DycTFpAk7Ph3
RoOPLvuekCgJEGUJ7vhzLPyr2x9+cAVtTShJxwzxYBThGHtgKBFbqONHUqZbGxtiAmIkLrEUJ/Bs
yniMJNzycCPg6BgGiOlGrVJpbcSIJP42WJTKUJ/Cv0QKJZhQPlRmsJegGEa/OZ2SCdbY4LCqEGIu
upR7R4h2fLAZsOMRfiB9jyIh4UHHr+g/f2P7ygbaypWoXKNr6A30X66XKwSHNT0mD8floI1Gs9Ha
Ke1rAJWruH673+q3SnsagCYTmGnmi2mzubu522vmWAOUXTps99q9etXCG/brKz7vNNXPwmtQZr+x
gh8MuhBFC69BGb65gm802rVuw8JrUIZvreDblZ1eo23hNSiiJDlcQVearXq3mG0JmTK654RvNhuD
di03vkBBNZTVpYaYskSuq7UY3Wd8AAAFpEiSxJPzFE/RBGqyiygZc+LtkzCCwktRwgSIK7XKoFKH
/+rX0Fc6ImgLI0Nb+QWeiBWR8scTE05S2fE/Aau+AXn94qfXL555Jw+fnzz89eTRo5OHv2SGLK09
lISm1qsfvvznyWfe38++f/X4azdemPg/fv7899++cgNhposQvPzm6Z/Pn7789ou/fnzsgO9wNDbh
IxJj4d3Ax95tFsPEdAhsz/GYv5nGKELE1NhJQoESpEZx2O/LyELfmCOKHLhdbEfwLgeKcQGvze5b
Dg8jPpPEYfF6FFvAA8boLuPOKFxXYxlhHs2S0D04n5m42wgducbuosTKb3+WArcSl8luhC03b1GU
SBTiBEtPPWOHGDtmd48QK64HZMKZYFPp3SPeLiLOkIzI2KqmhdIeiSEvc5eDkG8rNgd3vV1GXbPu
4SMbCW8Fog7nR5haYbyGZhLFLpMjFFMz4PtIRi4nh3M+MXF9ISHTIabM6wdYCJfOTQ7zNZJ+HejF
nfYDOo9tJJfk0GVzHzFmInvssBuhOHVhhySJTOzH4hBKFHm3mHTBD5j9hqh7yANK1qb7LsFWuk9n
gzvArKZLiwJRT2bckctrmFn1O5zTKcKaaoD4LT6PSXIquS/RevP/pXUg0pffPXHM6qIS+g4nzjdq
b4nG1+GWybvLeEAuPnf30Cy5heF1WW1g76n7PXX77zx1r3uf3z5hLzga6FstFbOlul64x2vX7VNC
6VDOKd4XeukuoDMFAxAqPb0/xeU+Lo3gUr3JMICFCznSOh5n8lMio2GEUljfV31lJBS56VB4KROw
7Ndip22Fp7P4gAXZdrVaVVvTjDwEkgt5pVnKYashM3SrvdiClea1t6HeKhcOKN03ccIYzHai7nCi
XQhVkPTGHILmcELP7K14senw4rIyX6RqxQtwrcwKLJ08WHB1/GYDVEAJdlSI4kDlKUt1kV2dzLeZ
6XXBtCoA1hFFBSwyval8XTs9Nbus1M6QacsJo9xsJ3RkdA8TEQpwXp1KehY33jTXm4uUWu6pUOjx
oLQWbrQv/5cX58016C1zA01MpqCJd9zxW/UmlMwEpR1/Ctt+uIxTqB2hlryIhnBgNpE8e+HPwywp
F7KHRJQFXJNOxgYxkZh7lMQdX02/TANNNIdo36o1IIQL69wm0MpFcw6SbicZT6d4Is20GxIV6ewW
GD7jCudTrX5+sNJkM0j3MAqOvTGd8dsISqzZrqoABkTA6U81i2ZA4DizJLJF/S01ppx2zfNEXUOZ
HNE0QnlHMck8g2sqL93Rd2UMjLt8zhBQIyR5IxyHqsGaQbW6adk1Mh/Wdt3TlVTkDNJc9EyLVVTX
dLOYNULRBpZieb4mb3hVhBg4zezwGXUvU+5mwXVL64SyS0DAy/g5uu4ZGoLh2mIwyzXl8SoNK87O
pXbvKCZ4imtnaRIG67cKs0txK3uEczgQnqvzg95y1YJoWqwrdaRdnyYOUOqNw2rHh88DcD7xAK7g
A4MPspqS1ZQMruCrAbSL7Ki/4+cXhQSeZ5ISUy8k9QLTKCSNQtIsJM1C0iokLd/TZ+LwHUYdh/te
ceQNPSw/Is/XFvb3m+1/AQAA//8DAFBLAwQUAAYACAAAACEAnGZGQbsAAAAkAQAAKgAAAGNsaXBi
b2FyZC9kcmF3aW5ncy9fcmVscy9kcmF3aW5nMS54bWwucmVsc4SPzQrCMBCE74LvEPZu0noQkSa9
iNCr1AcIyTYtNj8kUezbG+hFQfCyMLPsN7NN+7IzeWJMk3ccaloBQae8npzhcOsvuyOQlKXTcvYO
OSyYoBXbTXPFWeZylMYpJFIoLnEYcw4nxpIa0cpEfUBXNoOPVuYio2FBqrs0yPZVdWDxkwHii0k6
zSF2ugbSL6Ek/2f7YZgUnr16WHT5RwTLpRcWoIwGMwdKV2edNS1dgYmGff0m3gAAAP//AwBQSwEC
LQAUAAYACAAAACEAu+VIlAUBAAAeAgAAEwAAAAAAAAAAAAAAAAAAAAAAW0NvbnRlbnRfVHlwZXNd
LnhtbFBLAQItABQABgAIAAAAIQCtMD/xwQAAADIBAAALAAAAAAAAAAAAAAAAADYBAABfcmVscy8u
cmVsc1BLAQItABQABgAIAAAAIQAMIdvqTwIAAAIFAAAfAAAAAAAAAAAAAAAAACACAABjbGlwYm9h
cmQvZHJhd2luZ3MvZHJhd2luZzEueG1sUEsBAi0AFAAGAAgAAAAhALY7BCJUBgAACxoAABoAAAAA
AAAAAAAAAAAArAQAAGNsaXBib2FyZC90aGVtZS90aGVtZTEueG1sUEsBAi0AFAAGAAgAAAAhAJxm
RkG7AAAAJAEAACoAAAAAAAAAAAAAAAAAOAsAAGNsaXBib2FyZC9kcmF3aW5ncy9fcmVscy9kcmF3
aW5nMS54bWwucmVsc1BLBQYAAAAABQAFAGcBAAA7DAAAAAA=
">
<v:stroke endarrow="block"/>
</v:shape><![endif]--><!--[if !vml]--><span style="height: 55px; left: 0px; margin-left: 101px; margin-top: 499px; mso-ignore: vglayout; position: absolute; width: 110px; z-index: 251666432;"><br /></span><!--[endif]--><b><span lang="EN-US" style="font-family: "Times New Roman", serif;"><span style="font-size: large;">Finding the node speed, Position and
energy of a node</span></span></b></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">In this
Chapter, the runtime information like energy, position of the nodes and speed
of the nodes are computed/calculated at a particular instant of time. We have
taken AODV protocol as it is easier to configure and it is simple to change the
parameters. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">When
decided to use the AODV protocol, then the first step is to understand the
protocol by learning it through the C++ source files that were available with
the ns2 source. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Here
are the locations of the AODV source codes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">ns-allinone-2.35/ns-2.35/aodv/<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv.cc<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv.h<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv_logs.cc<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv_logs.o<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv.o<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv_packet.h<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv_rqueue.cc<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv_rqueue.h<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv_rqueue.o<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv_rtable.cc<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">|--
aodv_rtable.h<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">`--
aodv_rtable.o<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">There
are .cc, .h and .o files. The .cc and .h are the source files and .o is the
object file. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">The
header (.h) files are provided to know the functionalities of a given protocol
or algorithm by specifying the data members and member functions of a given
class with only definitions. The C Source files implements the functions defined
in the header files.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">The
runtime information for a mobile node is specified in </span><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">~/ns-allinone-2.35/ns-2.35/common/mobilenode.h</span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;"> which
has some list of functions as specified below. These functions may be included
inside the aodv source files and find the required information.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Some
functions of mobilenode.h<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify; text-indent: 36.0pt;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">inline
MobileNode*& next() { return next_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double X() { return X_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double Y() { return Y_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double Z() { return Z_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double speed() { return speed_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double dX() { return dX_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double dY() { return dY_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double dZ() { return dZ_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double destX() { return destX_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double destY() { return destY_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double radius() { return radius_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> inline double getUpdateTime() { return
position_update_time_; }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">For our
case1, we are going to modify two files in the </span><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">~ns-2.35/aodv/</span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">
folder. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">aodv.h
<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-left: 36.0pt; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">aodv.cc<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Step 1 : Make an entry in aodv.h <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Source
File : </span><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">~ns-2.35/aodv/aodv.h<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">include
the following header line in aodv.h in the beginning section of the file.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><b><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">#include <mobilenode.h><o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;"> </span><span style="font-family: "Times New Roman", serif; font-size: 12pt;">In the
aodv class, declare the following variables (in protected scope)</span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">double xpos; //
To define the x,y and z position<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">double ypos;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">double zpos;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">double iEnergy;
//to get the energy at a given instant of time <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">int node_speed;
//to find the node speed<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">MobileNode *iNode; //to create a node<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">FILE *fp; //to
get all the above information in a file for plotting<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Step 2: Make an entry in aodv.cc
constructor<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Source File : aodv.cc<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Declare
the following variables inside the aodv constructor, these following variables
were initialized in the aodv.h<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">xpos = 0.0;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">ypos = 0.0;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">zpos = 0.0;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">node_speed = 0;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">iEnergy=0.0;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">fp=fopen("pradeep.csv","w");//CSV
files are easily handled by spreadsheets<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">MobileNode *iNode;<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Step 3: Make an entry in aodv.cc<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">In AODV
protocol, the run time information is required during a forward of packet. So
AODV has a forward() function that handles the code related to the forwarding
of packets. So the function from the mobilenode.h will be called or used inside
the forward() function of AODV. Locate the forward() function implementation
and paste the following codes <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;">Finally
access the required functions from mobilenode.h. Paste the following lines in
the </span><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">void
AODV::forward(aodv_rt_entry *rt, Packet *p, double delay) {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">//Code by
pradeepkumar<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">/***This code
retrieves node position*****/<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">iNode =
(MobileNode*) (Node::get_node_by_address(index));<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">((MobileNode *)
iNode)->getLoc(&xpos,&ypos,&zpos);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">//Position of %d
, X, Y, Z<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">fprintf(fp,"%d,%f,%f,%f,",
index, xpos, ypos, zpos);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">/***This code
retrieves the nodes velocity*****/<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">iNode =
(MobileNode*) (Node::get_node_by_address(index));<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">((MobileNode *)
iNode)->getVelo(&xpos, &ypos, &zpos);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">//Velocity of %d
, X, Y, Z<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">fprintf(fp,"%d,%f,%f,%f,",
index, xpos, ypos, zpos);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">/***This code retrieves
the nodes Energy Value*****/<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">iNode =
(MobileNode*) (Node::get_node_by_address(index));<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">node_speed =
((MobileNode *) iNode)->speed();<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">iEnergy=iNode->energy_model()->energy();<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">//Velocity of %d
, Node Speed in m/s Energy in joules <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt;">fprintf(fp,"%d,%d,%f,",
index, node_speed,iEnergy);<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; text-align: justify;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;"> </span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Step
4:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Recompile ns2 to reflect the changes done
above. To recompile ns2, the detailed
steps are given in Appendix A. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">The simple step to recompile is, <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="mso-list: l3 level1 lfo1; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: "Courier New";">1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Go
to terminal and go to the folder </span><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt; line-height: 107%;">~ns-2.35/<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="mso-list: l3 level1 lfo1; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: "Times New Roman";">2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Give
the command </span><span lang="EN-US" style="font-family: "Courier New"; font-size: 12.0pt; line-height: 107%;">make</span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">To verify these changes, run any Wireless
tcl file with AODV as the protocol and to be included with energy model codes. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Here is a simple example to test the above
modification.<o:p></o:p></span></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: solid windowtext 1.0pt; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt 0cm 5.4pt; width: 467.5pt;" valign="top" width="935">
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">Listing
7.1 – Testing the AODV protocol for printing the runtime information<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(chan)
Channel/WirelessChannel
;#Channel Type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(prop)
Propagation/TwoRayGround ;#
radio-propagation model<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(netif) Phy/WirelessPhy ;# network interface type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(mac) Mac/Simple ;# MAC type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(ifq)
Queue/DropTail/PriQueue ;#
interface queue type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(ll) LL ;# link layer type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(ant)
Antenna/OmniAntenna ;#
antenna model<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(ifqlen) 50 ;# max packet in ifq<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(nn) 2 ;# number of
mobilenodes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(rp) AODV <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(x) 250<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
val(y) 250<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Initialize Global Variables<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
ns [new Simulator]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
tracef [open casestudy1.tr w]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
trace-all $tracef<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
namf [open casestudy1.nam w]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
namf-all-wireless $namf $val(x) $val(y)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
set up topography object<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
topo [new Topography]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$topo
load_flatgrid $val(x) $val(y)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Create God<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">create-god
$val(nn)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Create channel<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
chan_ [new $val(chan)]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Create node(0) and node(1)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
configure node, please note the change below.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
node-config -adhocRouting $val(rp) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -llType $val(ll) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -macType $val(mac) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -ifqType $val(ifq) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -ifqLen $val(ifqlen) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -antType $val(ant) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -propType $val(prop) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -phyType $val(netif) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -topoInstance $topo \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> <b>-energyModel "EnergyModel" \<o:p></o:p></b></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -initialEnergy 2.0 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -txPower 0.4 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -rxPower 0.1 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -agentTrace ON \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -routerTrace ON \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -macTrace ON \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -movementTrace ON \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> -channel $chan_<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">for
{set i 0} {$i < $val(nn)} {incr i} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> set node_($i) [$ns node]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> $node_($i) random-motion 0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> $ns initial_node_pos $node_($i) 20<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Provide initial (X,Y, for now Z=0) co-ordinates for mobilenodes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$node_(0)
set X_ 15.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$node_(0)
set Y_ 15.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$node_(0)
set Z_ 0.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$node_(1)
set X_ 150.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$node_(1)
set Y_ 150.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$node_(1)
set Z_ 0.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Now produce some simple node movements<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Node_(1) starts to move towards node_(0)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
at 0.0 "$node_(0) setdest 50.0 50.0 5.0"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
at 0.0 "$node_(1) setdest 60.0 40.0 10.0"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Node_(1) then starts to move away from node_(0)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
at 3.0 "$node_(1) setdest 240.0 240.0 30.0" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Setup traffic flow between nodes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
TCP connections between node_(0) and node_(1)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
tcp [new Agent/TCP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$tcp
set class_ 2<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
sink [new Agent/TCPSink]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
attach-agent $node_(0) $tcp<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
attach-agent $node_(1) $sink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
connect $tcp $sink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">set
ftp [new Application/FTP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ftp
attach-agent $tcp<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
at 0.5 "$ftp start" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#
Tell nodes when the simulation ends<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">for
{set i 0} {$i < $val(nn) } {incr i} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> $ns at 6.0 "$node_($i) reset";<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
at 6.0 "stop"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
at 6.01 "puts \"NS EXITING...\" ; $ns halt"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">proc
stop {} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> global ns tracef<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> $ns flush-trace<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> close $tracef<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;"> </span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">puts
"Starting Simulation..."<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Courier New"; font-size: 10.0pt;">$ns
run<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: normal; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt;"> </span></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Once the above script runs, a file
“pradeep.csv” would be created in the folder where this tcl file was interpreted.
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">The content of pradeep.csv is given below.
All the values are separated by comma, <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: "Times New Roman";">1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">The
first column is the index of the node, since there are 2 nodes (0 and 1 is the
index)<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: "Times New Roman";">2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">2<sup>nd</sup>,
3<sup>rd</sup> and 4<sup>th</sup> column represents the position of the nodes <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: "Times New Roman";">3.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">5<sup>th</sup>,
6<sup>th</sup> and 7<sup>th</sup> column represents the velocity of the node
with position<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: "Times New Roman";">4.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">8<sup>th</sup>
column represents the speed in m/s<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="mso-list: l1 level1 lfo2; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%; mso-fareast-font-family: "Times New Roman";">5.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">9<sup>th</sup>
columns represents the energy.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">0,22.511258,22.511258,0.000000,3.535534,3.535534,0.000000,5,1.618279,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">0,22.511258,22.511258,0.000000,3.535534,3.535534,0.000000,5,1.618279,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">0,22.552380,22.552380,0.000000,3.535534,3.535534,0.000000,5,1.614935,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">0,22.552380,22.552380,0.000000,3.535534,3.535534,0.000000,5,1.614935,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">0,22.575435,22.575435,0.000000,3.535534,3.535534,0.000000,5,1.613255,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">1,136.365972,133.336188,0.000000,-6.332378,-7.739573,0.000000,10,1.893608,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">1,136.331714,133.294317,0.000000,-6.332378,-7.739573,0.000000,10,1.893128,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">1,136.298089,133.253220,0.000000,-6.332378,-7.739573,0.000000,10,1.892712,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;"> </span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">7.3
Promiscuous Mode in AODV protocol<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Promiscuous Mode in AODV<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">In a network, promiscuous mode allows a
network device to intercept and read each network packet that arrives in its
entirety. This mode of operation is sometimes given to a network snoop server
that captures and saves all packets for analysis (for example, for monitoring
network usage). Its often used to monitor network activity. Promiscuous mode is happening at the Mac layer
and with the help of mac only, the promiscuous mode can be achieved in AODV
protocol.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Files to be modified are <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="margin-left: 38.25pt; mso-add-space: auto; mso-list: l2 level1 lfo3; text-indent: -20.25pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Courier New";">~ns-2.35/aodv/aodv.h<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="margin-left: 38.25pt; mso-add-space: auto; mso-list: l2 level1 lfo3; text-indent: -20.25pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Courier New";">~ns-2.35/aodv/aodv.cc<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="margin-left: 38.25pt; mso-add-space: auto; mso-list: l2 level1 lfo3; text-indent: -20.25pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Courier New"; mso-fareast-font-family: "Courier New";">3.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Courier New";">~ns-2.35/lib/tcl/ns-mobilenode.tcl<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Step
1:<o:p></o:p></span></b></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Source
File: </span></b><span lang="EN-US" style="font-family: "Courier New";">~ns-2.35/aodv/aodv.h<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Tap is a class that belongs to the mac and
it is used to tap a packet when it is forwarded or transmitted. To make it
happen with AODV, the aodv class should be the child class of Tap<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Make AODV agent a child class of Tap (you
should have a member function tap), and define the Mac variable<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">#include
<mac.h> //added at the beginning of the aodv.h<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">class
AODV: public Tap, public Agent {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">public:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">void
tap(const Packet *p);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">......<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">protected:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Mac
*mac_; <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">FILE *fs;
//to store the tapped packet information for analysis<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">int
count;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">......<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;"> </span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Step
2:<o:p></o:p></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Source File: </span><span lang="EN-US" style="font-family: "Courier New";">~ns-2.35/aodv/aodv.cc<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">In the
constructor of AODV protocol, add these two lines<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">fs =
fopen(“promis.csv”,”w”); //already the new FILE is added in the aodv.h file<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">count =0;
//initialize the count value to 0<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Define TCL command "</span><span lang="EN-US" style="font-family: "Courier New";">install-tap</span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">"
and implement </span><span lang="EN-US" style="font-family: "Courier New";">AODV::tap()<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Only when the ‘install-tap’ command is
implemented, the tapping of packets will happen. To know more about, how to
implement a command, refer Chapter 3 (Creation of a new agent). Already AODV
command() is implemented with various commands, the new command have to be
appended along with it as given below<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">int
AODV::command(int argc, const char*const* argv) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">......<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">else
if(argc == 3) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">......<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">//addition
of install-tap command<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">else if (strcmp(argv[1],
"install-tap") == 0) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">mac_ =
(Mac*)TclObject::lookup(argv[2]);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">if (mac_
== 0) return TCL_ERROR;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">mac_->installTap(this);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">return
TCL_OK;<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">} <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">return
Agent::command(argc, argv);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">void
AODV::tap(const Packet *p) {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">//The
following statement will print the node_id and the count packets. The last
value of the corresponding node_id will be taken as the node’s tapped value.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">fprintf(fs,”Node
id-%d, %d”, index,count++);<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">} <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";"> </span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Step 3:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Source
File: ~ns-2.35/lib/tcl/ns-mobilenode.tcl<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node/MobileNode
instproc add-target { agent port } {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">$self
instvar dmux_ imep_ toraDebug_ <b>mac_</b><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">......<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";"># Special
processing for AODV<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">set
aodvonly [string first "AODV" [$agent info class]] <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">if
{$aodvonly != -1 } {<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">$agent
if-queue [$self set ifq_(0)] ; # ifq between LL and MAC<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">$agent
install-tap $mac_(0); # this is the place where we call the command install-tap
for tapping the packets, the same line can be overridden inside the Tcl source
file also.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">......<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Step 4: <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Recompile
NS2 by typing the command make at the ~ns-2.35/ folder and test the mode.<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">For testing the above, a Tcl script with
AODV protocol have to be developed and to be plotted. The Listing 6.1 –
Wireless network with 2 nodes was tried for this and here is the sample output
for this. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">In this the Node 0 consumes 1117 packets
and Node 1 consumes (1133-1118) 16 packets as the node 0 is the sender node and
node1 is the receiver node. <o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 0, 1115<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 0, 1116<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 0, 1117<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1118<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1119<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1120<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1121<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1122<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1123<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1124<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1125<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1126<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1127<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1128<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1129<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1130<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1131<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1132<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Courier New";">Node
id-> 1, 1133<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">Using this promiscuous code, the network
usage can be calculated.<o:p></o:p></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;"> </span></b><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 107%;"><span style="font-size: large;">Conclusion</span></span></b></p>
<p class="MsoNormal"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 107%;">This chapter deals with the two different
modifications of existing protocol in ns2. The AODV protocol is a simple and
efficient in handling the energy and easy to customize, AODV protocol is chosen
for these two case studies. However the readers are advised to try these two
case studies for other protocols like DSR, DSDV and TORA. The results of all
these can also be compared.<o:p></o:p></span></p><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com3tag:blogger.com,1999:blog-8826608353769320919.post-38296504268142928562021-10-27T15:23:00.004+05:302021-10-27T15:23:55.534+05:30Wireless Networks in NS2 - NS2 Tutorial 6<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0.0001pt; text-align: left;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: x-large;">Wireless Networks</span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">In
this post:<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Introduction to Wireless networks<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tcl scripts for various wireless networks<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Unlike
Wired networks, wireless networks are a little tricky in dealing with the
network properties. Since wireless nodes have radio, physical layer, Mac
(Medium Access Control), Antenna, etc. Every parameter of those should be
addressed when configuring wireless networks. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">NS
provides a way to handle these properties through a construct called <b><i>node-config.
</i></b>The node configuration in ns2 is a special task in which the number of
nodes can be configured for a set of parameters. The following table tells
about the node configuration parameters as defined in the <b>~ns-2.35/tcl/ns-lib.tcl</b><o:p></o:p></span></p>
<p class="MsoListParagraph" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">The readers are requested to refer
the <b>ns-lib.tcl </b>file for more information.</span></p>
<h2 style="line-height: 150%; margin-bottom: 0.0001pt; text-align: left;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: large;">6.1 Wireless Node Configuration</span></span></b></h2>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">The
following table shows the complete node configuration that ns supports or
provides. The wireless nodes may be configured with all the parameters given
here or whatever is needed can be used to configure.</span></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableLightGridAccent6" style="border-collapse: collapse; border: none; mso-border-alt: solid #F79646 1.0pt; mso-border-themecolor: accent6; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184; width: 968px;">
<tbody><tr>
<td style="border-bottom: solid #F79646 2.25pt; border: 1pt solid rgb(247, 150, 70); mso-border-bottom-themecolor: accent6; mso-border-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 5;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Option<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 2.25pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: 1pt solid rgb(247, 150, 70); mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 154.5pt;" valign="top" width="309">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 1;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Available Values<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 2.25pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: 1pt solid rgb(247, 150, 70); mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 1;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Remarks<o:p></o:p></span></b></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">addressType<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 155.25pt;" valign="top" width="311">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">flat, hierarchical<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456"></td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99pt;" valign="top" width="198">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">MPLS<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">ON,OFF<o:p></o:p></span></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Multi protocol Label Switching<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">wiredRouting<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">ON, OFF<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456"></td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">llType<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">LL, LL/Sat<o:p></o:p></span></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Link Layer<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">macType<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Mac/802_11, Mac/Csma/Ca, Mac/Sat, Mac/Sat/UnslottedAloha,
Mac/Tdma<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Medium Access Control<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">ifqType<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Queue/DropTail, Queue/DropTail/PriQueue<o:p></o:p></span></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Interface Queue type<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">phyType<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Phy/wirelessPhy, Phy/Sat<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Physical Layer Type<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">adhocRouting<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">DIFFUSION/RATE, DIFFUSION/PROB, DSDV, DSR, FLOODING,
OMNIMCAST,AODV,TORA,PUMA<o:p></o:p></span></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">adhoc routing protocol<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">propType<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Propagation/TwoRayGround, Propagation/Shadowing<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Propagation Type<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">antType<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Antenna/OmniAntenna,<o:p></o:p></span></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Antenna type<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Channel<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Channel/WirelessChannel, Channel/Sat<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Channel to be used<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">mobileIP<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">ON,OFF<o:p></o:p></span></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">to set the IP for Mobile or not<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">energyModel<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">EnergyModel<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">energy model to be enabled or not<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">initialEnergy<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312"></td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">in terms of joules (Ex: 3.24)<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">txPower<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312"></td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Power in terms of Watts (0.32)<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">rxPower<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312"></td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Power in terms of Watts (0.1)<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">idlePower<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312"></td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Power in terms of Watts (0.02)<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">agentTrace<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">ON, OFF<o:p></o:p></span></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tracing to be on or off<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">routerTrace<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">ON, OFF<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tracing to be on or off<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">macTrace<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">ON, OFF<o:p></o:p></span></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tracing to be on or off<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">movementTrace<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">ON, OFF<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tracing to be on or off<o:p></o:p></span></p>
</td>
</tr>
<tr>
<td style="border-top: none; border: 1pt solid rgb(247, 150, 70); mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 132;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">errProc<o:p></o:p></span></b></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 128;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">UniformErrorProc<o:p></o:p></span></p>
</td>
<td style="border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456"></td>
</tr>
<tr>
<td style="background: rgb(253, 228, 208); border-top: none; border: 1pt solid rgb(247, 150, 70); mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 99.75pt;" valign="top" width="200">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 68;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">toraDebug<o:p></o:p></span></b></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 156pt;" valign="top" width="312">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-yfti-cnfc: 64;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">ON, OFF<o:p></o:p></span></p>
</td>
<td style="background: rgb(253, 228, 208); border-bottom: 1pt solid rgb(247, 150, 70); border-left: none; border-right: 1pt solid rgb(247, 150, 70); border-top: none; mso-background-themecolor: accent6; mso-background-themetint: 63; mso-border-bottom-themecolor: accent6; mso-border-left-alt: solid #F79646 1.0pt; mso-border-left-themecolor: accent6; mso-border-right-themecolor: accent6; mso-border-top-alt: solid #F79646 1.0pt; mso-border-top-themecolor: accent6; padding: 0cm 5.4pt; width: 228pt;" valign="top" width="456"></td>
</tr>
</tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">An
Example <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">$ns node-config -addressType <i>hierarchical</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -adhocRouting
<i>AODV</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -llType
<i>LL</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -macType
<i>Mac/802_11</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -ifqType
<i>Queue/DropTail/PriQueue</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -antType
<i>Antenna/OmniAntenna \</i><o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -propType
<i>Propagation/TwoRayGround</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -phyType
<i>Phy/WirelessPhy \</i><o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -topologyInstance
<i>$topo \<o:p></o:p></i></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -energyModel
<i>“EnergyModel”</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -initialEnergy
<i>3.0</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -txPower
<i>0.3</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -rxPower
<i>0.1</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><i><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -sleepPower 0.05 \<o:p></o:p></span></span></i></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span style="font-family: courier;"><i><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"> -idlePower 0.08 \</span></i><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -channel
<i>Channel/WirelessChannel \</i><o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -agentTrace
<i>ON \</i><o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -routerTrace
<i>OFF</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -movementTrace
<i>ON</i> \<o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> -macTrace
<i>OFF</i></span></span></p>
<h3 style="line-height: 150%; margin-bottom: 0.0001pt; text-align: left;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: medium;">6.
2 A Simple Wireless Configuration </span></span></b></h3>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">For every node creation, the above <b><i>node-config</i></b> has to be set in the
wireless networks. Now we will see a simple example related to wireless
networks.<o:p></o:p></span></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 478.8pt;" valign="top" width="958">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Listing 6.1 – A Two node wireless networks</span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># The following are the parameters to initialize
the wireless properties<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(chan)
Channel/WirelessChannel ;#
Type of channel<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(prop)
Propagation/TwoRayGround ;#
Radio model (propagation)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(netif)
Phy/WirelessPhy ;#
NIC (Interface Card)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(mac)
Mac/802_11 ;#
Medium Access Control (MAC)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ifq)
Queue/DropTail/PriQueue ;#
Type of queuing interface<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ll)
LL ;#
link layer type<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ant)
Antenna/OmniAntenna ;#
Antenna Model<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ifqlen)
50 ;#
max packet in interface queue<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(nn)
2 ;#
number of mobilenodes<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(rp)
DSDV ;#
routing protocol<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(x) 500<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(y) 500<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Initialize Global Variables<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ns [new
Simulator]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#set the tracing<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set tracef [open wrls1.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns trace-all $tracef<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#set the animation file<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set namf [open wrls1.nam w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns namtrace-all-wireless $namf $val(x) $val(y)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># set up topography object<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set topo [new
Topography]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># the topography just uses the 2D flatgrid
topology<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$topo load_flatgrid $val(x) $val(y)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Create God, GOD Means - General Operations
Director, god is taken care of all the nodes in the network. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">create-god $val(nn)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Create two channels, if there are multiple
channels, the nodes can be created either in channel 1 # or channel 2<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set channel1 [new $val(chan)]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set channel2 [new $val(chan)]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># configure node using the initialization
parameters that were declared in the beginning.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns node-config -adhocRouting $val(rp) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -llType
$val(ll) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -macType
$val(mac) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -ifqType
$val(ifq) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -ifqLen
$val(ifqlen) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -antType
$val(ant) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -propType
$val(prop) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -phyType
$val(netif) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -topoInstance
$topo \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -agentTrace
ON \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -routerTrace
ON \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -macTrace
ON \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -movementTrace
OFF \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -channel
$channel1<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set n0 [$ns node]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#the node n0 is associated with the channel1 and
the following node n1 created under the #channel2, if both the nodes are to
be enabled to a single channel, then comment the following #two lines <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#$ns node-config \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#
-channel $channel2<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set n1 [$ns node]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#disable the random motion for the nodes, if they
are mobile nodes. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n0 random-motion 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n1 random-motion 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#initial size of the node<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns initial_node_pos $n1 20<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns initial_node_pos $n0 20<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># initial position of the node, the Z axis is 0,
as the nodes are in a flatgrid<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n0 set X_ 5.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n0 set Y_ 2.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n0 set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n1 set X_ 8.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n1 set Y_ 5.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n1 set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#some mobility of the nodes, node1 moves to 50,40
at a speed of 25m/s<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 3.0 "$n1 setdest 50.0 40.0 25.0"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 3.0 "$n0 setdest 48.0 38.0 5.0"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#n1 is moving far away from n0 at a speed of 30m/s<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 10.0 "$n1 setdest 490.0 480.0 30.0" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Setup traffic flow between nodes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># TCP connections between n0 and n1<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set tcp [new Agent/TCP]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $n0 $tcp<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$tcp set class_ 2<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set sink [new Agent/TCPSink]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $n1 $sink<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns connect $tcp $sink<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ftp [new Application/FTP]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ftp attach-agent $tcp<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 3.0 "$ftp start" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Tell nodes when the simulation ends<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 20.0 "$n0 reset";<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 20.0 "$n1 reset";<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 20.0 "finish"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 20.01 "puts \"NS EXITING...\" ; $ns
halt"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">proc finish {} {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> global ns tracef
namf<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $ns flush-trace<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $tracef<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $namf<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts "Starting Simulation..."<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns run<o:p></o:p></span></b></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">The Listing 6.1 shows the wireless network with two
nodes that involves in a exchange of information. This network generates two
files a network animator file (wrls1.nam) and a trace file (wrls1.tr)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">The output of the <b>tracefile</b> is, here it shows
the first few lines of the <b>wrls1.tr</b> <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">s 0.029290548 _1_ RTR --- 0 message 32 [0 0 0 0] ------- [1:255
-1:255 32 0] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">s 0.029365548 _1_ MAC --- 0 message 90 [0 ffffffff 1 800] -------
[1:255 -1:255 32 0] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">r 0.030085562 _0_ MAC --- 0 message 32 [0 ffffffff 1 800] -------
[1:255 -1:255 32 0] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">r 0.030110562 _0_ RTR --- 0 message 32 [0 ffffffff 1 800] -------
[1:255 -1:255 32 0] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">s 1.119926192 _0_ RTR --- 1 message 32 [0 0 0 0] ------- [0:255
-1:255 32 0] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">s 1.120361192 _0_ MAC --- 1 message 90 [0 ffffffff 0 800] -------
[0:255 -1:255 32 0] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">r 1.121081207 _1_ MAC --- 1 message 32 [0 ffffffff 0 800] -------
[0:255 -1:255 32 0] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">r 1.121106207 _1_ RTR --- 1 message 32 [0 ffffffff 0 800] -------
[0:255 -1:255 32 0]</span><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Here is the analysis of the above trace file<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">ACTION: [s|r|D]: s -- sent, r -- received, D – dropped<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">WHEN: the time when the action happened<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">WHERE: the node where the action happened<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">LAYER: <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">AGT -- application, <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">RTR -- routing, <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">LL -- link layer (ARP is done here) <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">IFQ -- outgoing p’acket queue (between link and mac
layer) <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">MAC -- mac, <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">PHY – physical</span></b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">flags:<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">SEQNO: the sequence number of the packet<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">TYPE: the packet type cbr -- CBR data stream packet <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">DSR -- DSR routing packet (control packet generated by
routing) <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">RTS -- RTS packet generated by MAC 802.11 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">ARP -- link layer ARP packet<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">SIZE: the size of packet at current layer, when packet
goes down, size increases, goes up size decreases[a b c d]: a -- the packet
duration in mac layer header b -- the
mac address of destination c -- the mac
address of source d -- the mac type of
the packet body</span></b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">flags:<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">[......]: [
source node ip : port_number
destination node ip (-1 means broadcast) : port_number ip header ttl ip of next hop (0 means node 0 or
broadcast) ]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">So we can interpret the below trace<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">r 0.010176954 _9_ RTR
--- 1 gpsr 29 [0 ffffffff 8 800] ------- [8:255 -1:255 32 0]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%;">in the same way, as The routing agent on node 9
received a GPSR broadcast (mac address 0xff, and ip address is -1, either of
them means broadcast) routing packet whose ID is 1 and size is 19 bytes, at
time 0.010176954 second, from node 8 (both mac and ip addresses are 8), port
255 (routing agent)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">The output of the network animation file is <o:p></o:p></span></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHDp39tsdYjzrYIvCDW_vnRY3wyjdShXWnClenMiUZ1RwJTQC4UY-vXwkiDyA5EXheBSylpo26GL0JaPh6simA2BC6JHHLN_XDfHpWz3QSP6seAbagxBORnvot7uJrOl8ufekw_5EeYJc/s1362/61.png" style="margin-left: auto; margin-right: auto;"><img alt="Network Animation Window" border="0" data-original-height="736" data-original-width="1362" height="346" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHDp39tsdYjzrYIvCDW_vnRY3wyjdShXWnClenMiUZ1RwJTQC4UY-vXwkiDyA5EXheBSylpo26GL0JaPh6simA2BC6JHHLN_XDfHpWz3QSP6seAbagxBORnvot7uJrOl8ufekw_5EeYJc/w640-h346/61.png" title="Network Animation Window" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;">Network Animation Window</span></b></td></tr></tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">This example though it performs a little work, but
the results it gives are tremendous. There are so many parameters that change
during the execution of the network. Some of the performance characteristics
are listed:<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Throughput of Generating packets or sending packets<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">End to End delay between the nodes<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Packet Delivery ratio.<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Packet loss and packet drop calculation<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Jitter <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Energy used by the nodes <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l6 level1 lfo3; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">And so many other parameters.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">These parameters are calculated based on the
contents of the trace file. There are so many softwares available to process
these trace files. Xgraph is a utility that comes with ns-allinone package and
is very useful to predict the performance metrics. There are other third party
software that can be used to process these trace files, <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l5 level1 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Tracegraph<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">a.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Tracegraph is not
actively maintained and it is using matlab runtime libraries.<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">b.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">It does not
process the energy values in the trace file<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">c.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Very easy to
handle, just open the file using a GUI windows and rest taken care by the
software. <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">d.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Its free and open
source. This software can be downloaded at [5]. <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">e.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">More information
about Tracegraph and GnuPlot is available at Appendix D<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l5 level1 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">2.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">GnuPlot<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">a.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">This is also free
and easy to handle<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">b.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Need to specify
the axis manually and results are great looking.<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l5 level1 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">3.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Matlab<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">a.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Its runtime
libraries are responsible for processing the data.<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">b.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">It’s a
proprietary software<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l5 level1 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">4.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">AWK programming
language<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">a.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Its one of the
powerful programming language that can process the data column wise.<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l5 level2 lfo4; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">b.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Its open source
and free. Refer Appendix B for more information<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Analysis using Tracegraph, Listing 6.1 has two nodes
that involves a TCP traffic flow and the nodes were moving. In this case, at
the end of the simulation, both the nodes were away from each other and a
packet drop and packet loss occurs. These results can be predicted using
tracegraph as indicated below.<o:p></o:p></span></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtNQNZPjiciNhCAXPehyphenhyphenfOMvP9Mu-Ld-qlqwUrW4v9WYc3hzpCBW7ikUhNVfNvMBEwyHsIcSiEpKHe2RRXAIh5RCwa8VwKYEICDV96WaGy8cKHxt2UHJBQ9u2i6ujIpq0xKJuPEQiW-KQ/s806/62.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="A 3d Graph that shows the generation of packets at all the nodes" border="0" data-original-height="787" data-original-width="806" height="624" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtNQNZPjiciNhCAXPehyphenhyphenfOMvP9Mu-Ld-qlqwUrW4v9WYc3hzpCBW7ikUhNVfNvMBEwyHsIcSiEpKHe2RRXAIh5RCwa8VwKYEICDV96WaGy8cKHxt2UHJBQ9u2i6ujIpq0xKJuPEQiW-KQ/w640-h624/62.jpg" title="A 3d Graph that shows the generation of packets at all the nodes" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 24px; mso-fareast-font-family: "Times New Roman";"> A 3d Graph that shows the generation of packets at all the nodes</span></b></td></tr></tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkLxz96XB0UukH3A4gKRdQoDaTkjcq9iHxEp6AM9mKNh410qHNgUE7akgoweha3xBl-7aC22SND35DgCdwbgTl_3jRDpktu11gQCx-bP8oaKuOenZfV-rV5asOcaACS7OIxyY5ARGDeyk/s1089/63.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Average End to End delay for Sending bits" border="0" data-original-height="762" data-original-width="1089" height="448" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkLxz96XB0UukH3A4gKRdQoDaTkjcq9iHxEp6AM9mKNh410qHNgUE7akgoweha3xBl-7aC22SND35DgCdwbgTl_3jRDpktu11gQCx-bP8oaKuOenZfV-rV5asOcaACS7OIxyY5ARGDeyk/w640-h448/63.jpg" title="Average End to End delay for Sending bits" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 24px; mso-fareast-font-family: "Times New Roman";">Average End to End delay for Sending bits</span></b></td></tr></tbody></table><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDVXc1eGC2kkXExzq4j5fJPIL7tzaQG-DrkGkj-SLXTGYftg32o7UQScGv9eoT6RSo_3QHjj6uqvW8cOVLuv09Ht8Xtvbj0gjbXkV8_7k640lMlKVbnpY5eZ48QQmwRkmoQaioY-dYWME/s1088/64.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Cumulative sum of dropped bytes of RTS packets at all nodes" border="0" data-original-height="744" data-original-width="1088" height="438" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDVXc1eGC2kkXExzq4j5fJPIL7tzaQG-DrkGkj-SLXTGYftg32o7UQScGv9eoT6RSo_3QHjj6uqvW8cOVLuv09Ht8Xtvbj0gjbXkV8_7k640lMlKVbnpY5eZ48QQmwRkmoQaioY-dYWME/w640-h438/64.jpg" title="Cumulative sum of dropped bytes of RTS packets at all nodes" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 24px; mso-fareast-font-family: "Times New Roman";">Cumulative sum of dropped bytes of RTS packets at all nodes<br /></span><br /></b><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKUW78Sa9HXZv92v9W0c7awMIecJh916CqsC67spZXlhD4tpLcrj5cW5LNfX9lyQ46fajzY4Vjr9gYepWINZ2fPc8ChFBhzS1x4svBnSVt6e5iduEp3m1UDv11wZfVenVkIb0STFpzRtI/s1081/65.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Throughput of all generated packets at all nodes" border="0" data-original-height="727" data-original-width="1081" height="430" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKUW78Sa9HXZv92v9W0c7awMIecJh916CqsC67spZXlhD4tpLcrj5cW5LNfX9lyQ46fajzY4Vjr9gYepWINZ2fPc8ChFBhzS1x4svBnSVt6e5iduEp3m1UDv11wZfVenVkIb0STFpzRtI/w640-h430/65.jpg" title="Throughput of all generated packets at all nodes" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 24px; mso-fareast-font-family: "Times New Roman";">Throughput of all generated packets at all nodes<br /><br /></span></b></td></tr></tbody></table></td></tr></tbody></table><br /><p align="center" class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; text-align: center;"><span style="font-family: "Times New Roman", serif; font-size: 12pt; text-align: left;"> </span><span style="font-family: "Times New Roman", serif; font-size: 12pt; text-align: left;">The above graphs, plots the various performance
characteristics of the given wireless network and each graph tells some
information about the network. For example, in the above graph, there are two
waveforms, one refers the throughput of generating packets at all nodes and the
smaller one refers the throughput of generating packets of RTS at all nodes. From
the above figure, it was assumed that the RTS packets are limited in generation
compared with the other packets in the network.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Also the tracegraph software will present the text
based information about the network. The following figure shows <o:p></o:p></span></p><p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU6yxwaMOerJ3umovaj5iL3Gh2sAA8Ux6o4zlgaDoRwA1RfNgx8ll7B5Q2AgRZnGVS7Jepbm4pErXlqly6MrEyXk6quq8po2ymy7ERCi3AS8lMFXqzEpcrGswmfoorXkQRGdSUzaT_Xrk/s660/66.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Simulation Information" border="0" data-original-height="331" data-original-width="660" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiU6yxwaMOerJ3umovaj5iL3Gh2sAA8Ux6o4zlgaDoRwA1RfNgx8ll7B5Q2AgRZnGVS7Jepbm4pErXlqly6MrEyXk6quq8po2ymy7ERCi3AS8lMFXqzEpcrGswmfoorXkQRGdSUzaT_Xrk/w640-h320/66.jpg" title="Simulation Information" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 24px; mso-fareast-font-family: "Times New Roman";"> Simulation Information</span></b></td></tr></tbody></table><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSimYmIJNrdiYQvFuw8awgjQznqdKx1ictvFlFazli1DSv_fk_td1Rq3GUsridSJw84VNuSaMuL8WJAAKrxRSlDuX801ypxfbZoXp0-mn05GEJrLV7YBLOdlYIHRQEQVqvSCdpDHzgirA/s691/67.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="End to End delay" border="0" data-original-height="90" data-original-width="691" height="84" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiSimYmIJNrdiYQvFuw8awgjQznqdKx1ictvFlFazli1DSv_fk_td1Rq3GUsridSJw84VNuSaMuL8WJAAKrxRSlDuX801ypxfbZoXp0-mn05GEJrLV7YBLOdlYIHRQEQVqvSCdpDHzgirA/w640-h84/67.jpg" title="End to End delay" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 24px; mso-fareast-font-family: "Times New Roman";">End to End delay</span></b></td></tr></tbody></table></p>
<p align="center" class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; text-align: center;"><span style="font-family: "Times New Roman", serif; font-size: 12pt; text-align: left;">The simulation information shows the number of
dropped packets is 69 and lost packets are 1427 and both the nodes (0 and 1) are
dropping the packets.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">6.3
Energy Model in Wireless networks<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Real wireless nodes are equipped with battery that
will last long only when the batteries are charged. In a simulator environment,
implementing a battery model is always challenging as the battery has a non
linear characteristics. However, ns implements a energy model for wireless
nodes that uses functions based on the energy usage of the nodes during
transmitting, receiving, sleeping and
even when the nodes are idle. In Listing 6.1, the nodes are not enabled with
energy model, hence the nodes uses infinite amount of energy which in practice
is extinct. Listing 6.2 implements energy model for the nodes as listed below: <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Energy unit is given in Joules and Power consumption
is calculated based on usage in Watts<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">As we know the energy and power relation is <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Power
X Time = Energy,<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">As per the above equation, even when the node is
sleeping or idle, power is consumed as we use our real Smart Phones or Mobile
phones (that consumes power or the antenna is always on to receive the signal)<o:p></o:p></span></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 478.8pt;" valign="top" width="958">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Listing 6.3 – Wireless Network with Energy Model<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># The following are the parameters to initialize the
wireless properties<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(chan)
Channel/WirelessChannel ;#
Type of channel<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(prop)
Propagation/TwoRayGround ;#
Radio model (propagation)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(netif)
Phy/WirelessPhy ;#
NIC (Interface Card)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(mac)
Mac/802_11 ;#
Medium Access Control (MAC)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ifq)
Queue/DropTail/PriQueue ;#
Type of queuing interface<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ll)
LL ;#
link layer type<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ant)
Antenna/OmniAntenna ;#
Antenna Model<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ifqlen)
50 ;#
max packet in interface queue<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(nn) 4 ;# number of
mobilenodes<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(rp)
DSDV ;#
routing protocol<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(x) 500<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(y) 500<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Initialize Global Variables<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ns [new
Simulator]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">#set the tracing<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set tracef [open wrls2.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns trace-all $tracef<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">#set the animation file<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set namf [open wrls2.nam w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns namtrace-all-wireless $namf $val(x) $val(y)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># set up topography object<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set topo [new
Topography]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># the topography just uses the 2D flatgrid topology<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$topo load_flatgrid $val(x) $val(y)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Create God, GOD Means - General Operations Director, god
is taken care of all the nodes in the network. <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">create-god $val(nn)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Create a wireless channel<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set channel1 [new $val(chan)]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># configure node using the initialization parameters that
were declared in the beginning.<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns node-config -adhocRouting $val(rp) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -llType
$val(ll) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -macType
$val(mac) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -ifqType
$val(ifq) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -ifqLen
$val(ifqlen) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -antType
$val(ant) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -propType
$val(prop) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -phyType
$val(netif) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -topoInstance
$topo \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -energyModel
"EnergyModel" \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -initialEnergy
3.2 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -txPower
0.3 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -rxPower
0.1 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -sleepPower
0.05 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -idlePower
0.1 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -agentTrace
ON \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -routerTrace
ON \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -macTrace
ON \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -movementTrace
OFF \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -channel
$channel1<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set n0 [$ns node]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set n1 [$ns node]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set n2 [$ns node]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">#disable the random motion for the nodes, if they are
mobile nodes. <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n0 random-motion 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n1 random-motion 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n2 random-motion 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">#initial size of the node<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns initial_node_pos $n1 20<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns initial_node_pos $n0 20<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns initial_node_pos $n2 20<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># initial position of the node, the Z axis is 0, as the
nodes are in a flatgrid<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n0 set X_ 5.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n0 set Y_ 2.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n0 set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n1 set X_ 8.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n1 set Y_ 5.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n1 set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n2 set X_ 18.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n2 set Y_ 15.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$n2 set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">#some mobility of the nodes, node1 moves to 50,40 at a
speed of 25m/s<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 3.0 "$n1 setdest 50.0 40.0 25.0"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 3.0 "$n0 setdest 48.0 38.0 5.0"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 4.0 "$n2 setdest 100.0 100.0 40.0"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">#n1 is moving far away from n0 at a speed of 30m/s<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 10.0 "$n1 setdest 490.0 480.0 30.0" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Setup traffic flow between nodes<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># TCP connections between n0 and n1<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set tcp [new Agent/TCP]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $n0 $tcp<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$tcp set class_ 2<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set sink [new Agent/TCPSink]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $n1 $sink<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns connect $tcp $sink<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ftp [new Application/FTP]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ftp attach-agent $tcp<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 3.0 "$ftp start" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Tell nodes when the simulation ends<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 20.0 "$n0 reset";<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 20.0 "$n1 reset";<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 20.0 "finish"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 20.01 "puts \"NS EXITING...\" ; $ns
halt"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">proc finish {} {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> global ns tracef
namf<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $ns flush-trace<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $tracef<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $namf<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts "Starting Simulation..."<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns run<o:p></o:p></span></b></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">In the Listing 6.2, the following codes are added
for including energy model into the nodes <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -energyModel
"EnergyModel" \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -initialEnergy 3.2 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -txPower 0.3 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -rxPower 0.1 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -sleepPower 0.05 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -idlePower 0.1 \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">These codes includes the energy consumption while<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Transmitting <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Receiving <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Sleeping<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Even when the node is idle <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Transition energy also is one of the factor<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">The output trace file includes extra column for
energy usage too.as shown below<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">s 0.032821055 _1_ RTR --- 0 message 32 [0 0 0 0]<b> [energy
3.200000 ei 0.000 es 0.000 et 0.000 er 0.000]</b> ------- [1:255 -1:255 32 0] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">The bold letters in the above line indicates the
energy level trace.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">energy</span></b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> – initial energy value which is given as 3.2 Joules<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">ei – idle energy<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">es – sleep energy<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">et – transmission energy<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">er – reception energy<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">following Fig shows the picture of energy level Nodes. The
figure shows the nodes are in Green color and when the node’s energy comes to a
threshold value, it changes to yellow and if the energy completely drained then
the nodes die indicated by changing the color to red. <o:p></o:p></span></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWUPxy-PegSSL0TqGjWMxacJ9bV3D1N_r5X8cKAmQR3etvDziSskim2mbWzKGk0mpSArGIXUqVaFh_CRd1FrL0W06mCMmS8l_vPvGIGW2iVI2oR9oXwCID8A9_TQPtN8TEIp3AognNEF4/s1356/68.jpg" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="Wireless network with energy Model" border="0" data-original-height="654" data-original-width="1356" height="308" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWUPxy-PegSSL0TqGjWMxacJ9bV3D1N_r5X8cKAmQR3etvDziSskim2mbWzKGk0mpSArGIXUqVaFh_CRd1FrL0W06mCMmS8l_vPvGIGW2iVI2oR9oXwCID8A9_TQPtN8TEIp3AognNEF4/w640-h308/68.jpg" title="Wireless network with energy Model" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 24px; mso-fareast-font-family: "Times New Roman";">Wireless network with energy Model</span></b></td></tr></tbody></table><b style="text-align: center;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">6.4
– Performance characteristics in Wireless Adhoc networks<o:p></o:p></span></b></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 478.8pt;" valign="top" width="958">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Listing 6.3 – Plotting the performance characteristics in
wireless adhoc networks<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Defining Node Configuration paramaters<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(chan)
Channel/WirelessChannel ;#
channel type<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(prop)
Propagation/TwoRayGround ;#
radio-propagation model<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(netif)
Phy/WirelessPhy ;#
network interface type<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(mac)
Mac/802_11 ;# MAC
type<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ifq) Queue/DropTail/PriQueue ;# interface queue type<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ll)
LL ;#
link layer type<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ant)
Antenna/OmniAntenna ;#
antenna model<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(ifqlen)
50 ;#
max packet in ifq<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(nn)
8 ;#
number of mobilenodes<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(rp)
DSDV ;#
routing protocol<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(x)
500 ;# X
dimension of the topography<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set val(y) 500 ;# Y dimension of
the topography<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Set the Mac Parameters, for more parameters, refer the
~ns-2.35/lib/ns-default.tcl <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Mac/802_11 set RTSThreshold_ 3000<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Mac/802_11 set basicRate_ 1Mb<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Mac/802_11 set dataRate_
2Mb<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># creation of tracefiles for various metrics<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># *** Throughput Trace ***<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f0 [open thru02.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f1 [open thru12.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f2 [open thru22.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f3 [open thru32.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># *** Packet Loss Trace ***<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f4 [open pktloss02.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f5 [open pktloss12.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f6 [open pktloss22.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f7 [open pktloss32.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># *** Packet Delay Trace ***<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f8 [open pktdelay02.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f9 [open pktdelay12.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f10 [open pktdelay22.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set f11 [open pktdelay32.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Simulator Object<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ns [new Simulator]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Trace file initialization<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set tracef [open
wireless3.tr w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns trace-all $tracef<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Network Animator<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set namf [open wireless3.nam w]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns namtrace-all-wireless $namf $val(x) $val(y)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Topography<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set topo [new
Topography]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$topo load_flatgrid 500 500<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">#creation of god (General Operations Director) object<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">create-god $val(nn)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># configure nodes<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $ns
node-config -adhocRouting $val(rp) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-llType $val(ll) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-macType $val(mac) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-ifqType $val(ifq) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-ifqLen $val(ifqlen) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-antType $val(ant) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-propType $val(prop) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-phyType $val(netif) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> -channelType $val(chan) \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-topoInstance $topo \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-agentTrace ON \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-routerTrace ON \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-macTrace OFF \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
-movementTrace OFF <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Creation of Nodes<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> for {set i 0}
{$i < $val(nn) } {incr i} {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> set
node_($i) [$ns node]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
$node_($i) random-motion 0
;# disable random motion<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> }<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">#initial position of nodes<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(0) set X_ 5.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(0) set Y_ 5.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(0) set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(1) set X_ 10.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(1) set Y_ 15.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(1) set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(2) set X_ 35.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(2) set Y_ 250.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(2) set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(3) set X_ 10.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(3) set Y_ 50.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(3) set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(4) set X_ 235.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(4) set Y_ 10.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(4) set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(5) set X_ 400.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(5) set Y_ 100.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(5) set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(6) set X_ 285.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(6) set Y_ 150.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(6) set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(7) set X_ 120.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(7) set Y_ 115.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$node_(7) set Z_ 0.0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Create traffic flow using UDP with Constant Bit Rate
Application<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># this includes priority and the sink is LossMonitor agent
to trace the bytes received (because the Null Agent does not handle this)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set agent1 [new Agent/UDP] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$agent1 set prio_ 0 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set sink [new Agent/LossMonitor] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(0) $agent1 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(1) $sink <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns connect $agent1 $sink <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set app1 [new Application/Traffic/CBR]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app1 set packetSize_ 512 ; # setting the packet size <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app1 set rate_ 600Kb ; # setting the rate at which
the packets are transmitted<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app1 attach-agent $agent1 ; # attaching the agent<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set agent2 [new Agent/UDP] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$agent2 set prio_ 1 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set sink2 [new Agent/LossMonitor] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(2) $agent2 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(3) $sink2 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns connect $agent2 $sink2 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set app2 [new Application/Traffic/CBR] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app2 set packetSize_ 512 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app2 set rate_ 600Kb <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app2 attach-agent $agent2 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set agent3 [new Agent/UDP] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$agent3 set prio_ 2 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set sink3 [new Agent/LossMonitor] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(4) $agent3 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(5) $sink3 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns connect $agent3 $sink3 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set app3 [new Application/Traffic/CBR]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app3 set packetSize_ 512 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app3 set rate_ 600Kb <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app3 attach-agent $agent3<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set agent4 [new Agent/UDP]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$agent4 set prio_ 3
<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set sink4 [new Agent/LossMonitor] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(6) $agent4 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(7) $sink4 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns connect $agent4 $sink4 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set app4 [new Application/Traffic/CBR] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app4 set packetSize_ 512
<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app4 set rate_ 600Kb <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$app4 attach-agent $agent4 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># defines the node size in Network Animator<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">for {set i 0} {$i < $val(nn)} {incr i} {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $ns
initial_node_pos $node_($i) 20<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Initialize Flags<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ht 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set hs 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ht1 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set hs1 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ht2 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set hs2 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ht3 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set hs3 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set hr1 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set hr2 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set hr3 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set hr4 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Function To record Statistcis (Bit Rate, Delay, Drop)<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">proc record {} {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> global sink
sink2 sink3 sink4 f0 f1 f2 f3 f4 f5 f6 f7 ht hs ht1 hs1 ht2 hs2 ht3 hs3 f8 f9
f10 f11 hr1 hr2 hr3 hr4<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set ns [Simulator instance]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set time 0.9 ;#Set Sampling Time to 0.9 Sec<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw0 [$sink set bytes_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw1 [$sink2 set bytes_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw2 [$sink3 set bytes_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw3 [$sink4 set bytes_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw4 [$sink set nlost_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw5 [$sink2 set nlost_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw6 [$sink3 set nlost_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw7 [$sink4 set nlost_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw8 [$sink set lastPktTime_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw9 [$sink set npkts_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw10 [$sink2 set lastPktTime_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw11 [$sink2 set npkts_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw12 [$sink3 set lastPktTime_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw13 [$sink3 set npkts_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw14 [$sink4 set lastPktTime_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set bw15 [$sink4 set npkts_]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">set now [$ns now]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Record the Bit Rate in Trace Files<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts $f0 "$now [expr
(($bw0+$hr1)*8)/(2*$time*1000000)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts $f1 "$now [expr
(($bw1+$hr2)*8)/(2*$time*1000000)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts $f2 "$now [expr
(($bw2+$hr3)*8)/(2*$time*1000000)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts $f3 "$now [expr
(($bw3+$hr4)*8)/(2*$time*1000000)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Record Packet Loss Rate in File<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts $f4 "$now [expr $bw4/$time]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts $f5 "$now [expr $bw5/$time]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts $f6 "$now [expr $bw6/$time]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts $f7 "$now [expr $bw7/$time]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Record Packet Delay in File<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">if { $bw9 > $hs } {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> puts $f8
"$now [expr ($bw8 - $ht)/($bw9 - $hs)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> } else {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> puts
$f8 "$now [expr ($bw9 - $hs)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> }<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> if { $bw11
> $hs1 } {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> puts
$f9 "$now [expr ($bw10 - $ht1)/($bw11 - $hs1)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> } else {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> puts
$f9 "$now [expr ($bw11 - $hs1)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> }<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> if { $bw13
> $hs2 } {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> puts
$f10 "$now [expr ($bw12 - $ht2)/($bw13 - $hs2)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> } else {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> puts
$f10 "$now [expr ($bw13 - $hs2)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> }<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> if { $bw15
> $hs3 } {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> puts
$f11 "$now [expr ($bw14 - $ht3)/($bw15 - $hs3)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> } else {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> puts
$f11 "$now [expr ($bw15 - $hs3)]"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> }<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> # Reset
Variables<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $sink set
bytes_ 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $sink2 set
bytes_ 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $sink3 set
bytes_ 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $sink4 set
bytes_ 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $sink set
nlost_ 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $sink2 set
nlost_ 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $sink3 set nlost_
0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $sink4 set
nlost_ 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> set ht $bw8<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> set hs $bw9<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> set hr1 $bw0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> set hr2 $bw1<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> set hr3 $bw2<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> set hr4 $bw3<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $ns at [expr
$now+$time] "record" ;#
Schedule Record after $time interval sec<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Start Recording at Time 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 0.0 "record"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 1.4 "$app1 start" ;# Start transmission
at 2 Sec<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 10.0 "$app2 start" ;# Start transmission at 5 Sec<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 20.0 "$app3 start" ;# Start transmission at 15
Sec<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 30.0 "$app4 start" ;# Start transmission at 25
Sec<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Stop Simulation at Time 70 sec<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 80.0 "finish"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Reset Nodes at time 80 sec<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">for {set i 0} {$i < $val(nn) } {incr i} {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $ns at 80.0
"$node_($i) reset";<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># Exit Simulation at Time 70.01 sec<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns at 80.01 "puts \"NS EXITING...\" ; $ns
halt"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">proc finish {} {<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> global ns
tracefd f0 f1 f2 f3 f4 f5 f6 f7 f8 f9 f10 f11<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> # Close Trace
Files<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f0 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f1<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f2<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f3<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f4 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f5<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f6<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f7<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f8<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f9<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f10<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $f11<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> # Plot the
characteristics using xgrapg<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> exec xgraph
thru02.tr thru12.tr thru22.tr thru32.tr -geometry 800x400 &<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> exec xgraph
pktloss02.tr pktloss12.tr pktloss22.tr pktloss32.tr -geometry 800x400 &<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> exec xgraph
pktdelay02.tr pktdelay12.tr pktdelay22.tr pktdelay32.tr -geometry 800x400
&<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> # Reset Trace
File<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> $ns flush-trace<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> close $tracef<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> exit 0<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">puts "Starting Simulation..."<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">$ns run<o:p></o:p></span></b></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">The Listing 6.3 uses <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">8 wireless nodes with adjusted mac parameters<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">UDP Agent for Source agent<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">LossMonitor agent to trace the received bytes<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Each agent has a priority value from ( 0 to 3). There are four flows<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l7 level1 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-bidi-font-weight: bold; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">The characteristics that were plotted are <o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l7 level2 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Courier New";">o<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Packet loss<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l7 level2 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Courier New";">o<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Packet Delay<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="line-height: 150%; margin-bottom: 0cm; margin-left: 72.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 72pt; mso-add-space: auto; mso-list: l7 level2 lfo5; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Courier New";">o<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Throughput<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">The Network animation looks likes the following (8
nodes with packet exchange)</span></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimQ6yL9KIDTB5nSL6iuqNVlraXY3xxZsgHxegOBI4o63Q6hvlwCAFLkpeMnxy1DapQeUFKDqsXIFGYXsft880zlgY_YLkY8-S2zL5w94RMAwsDHrLCWTbEHU6C-1lLdQjABZSyKq4ZR_c/s1357/node.png" style="margin-left: auto; margin-right: auto; text-align: center;"><img border="0" data-original-height="704" data-original-width="1357" height="332" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEimQ6yL9KIDTB5nSL6iuqNVlraXY3xxZsgHxegOBI4o63Q6hvlwCAFLkpeMnxy1DapQeUFKDqsXIFGYXsft880zlgY_YLkY8-S2zL5w94RMAwsDHrLCWTbEHU6C-1lLdQjABZSyKq4ZR_c/w640-h332/node.png" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Nam Animation</td></tr></tbody></table><p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">And
the characteristics are shown below</span></b></p>
<p class="MsoListParagraph" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l1 level1 lfo8; text-indent: -18pt;"><!--[if !supportLists]--><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">1.<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; font-weight: normal; line-height: normal;"> </span></span></b></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2xH45iGK2ZKtrhFLqafyNg7I9v7t4dL4oWJSwU7vnFLLq_MipNxCDT-BKeq6KIvxo52qQ3OmPutz0fdUmJdBPutO8KNSo-TfJ_QKrqNNfWby_F9rtvMf53fKNh6QXqSzXIPZiSbnahPI/s802/packetdelay.png" style="margin-left: auto; margin-right: auto; text-align: center;"><img alt="Packet Delay for various traffic flow" border="0" data-original-height="426" data-original-width="802" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj2xH45iGK2ZKtrhFLqafyNg7I9v7t4dL4oWJSwU7vnFLLq_MipNxCDT-BKeq6KIvxo52qQ3OmPutz0fdUmJdBPutO8KNSo-TfJ_QKrqNNfWby_F9rtvMf53fKNh6QXqSzXIPZiSbnahPI/w640-h340/packetdelay.png" title="Packet Delay for various traffic flow" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b style="text-align: left; text-indent: -24px;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;">Packet Delay for various traffic flow<br /><br /></span></b></td></tr></tbody></table>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc4G4brT2AHJ28pZovV3qqWDfHh3Lbr2KogI9Ae3xKjx1d78uIfWyUH60ri0LsMPJvAo3NmtHtzz8CgcpF5D6Yfz7J33ma4uUoXQtiB5aYBc2OJzvTiILJKyWqpuTLzX5OaJf9JCgbnPo/s802/packetloss.png" style="margin-left: auto; margin-right: auto; text-align: center;"><img alt="Packet Loss for various traffic flows" border="0" data-original-height="422" data-original-width="802" height="336" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhc4G4brT2AHJ28pZovV3qqWDfHh3Lbr2KogI9Ae3xKjx1d78uIfWyUH60ri0LsMPJvAo3NmtHtzz8CgcpF5D6Yfz7J33ma4uUoXQtiB5aYBc2OJzvTiILJKyWqpuTLzX5OaJf9JCgbnPo/w640-h336/packetloss.png" title="Packet Loss for various traffic flows" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b style="text-align: left; text-indent: -24px;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;">Packet Loss for various traffic flows</span></b></td></tr></tbody></table><p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<div class="separator" style="clear: both; text-align: center;"><br /></div><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdGs0qg9gVSGrgoQaV4rtxmrCjrZC1aJ1tGHKZEwzGFmqqy0OXXtEbxtK5V8LkDMUy-xIRNYnh3eMOsQSMknCFo9VKUHJFpL288LwOh3ryf8oZyp3WkoCBHvVLMaSnuixbDYI9_-kgBe4/s803/throu.png" style="margin-left: auto; margin-right: auto;"><img alt="Throughput for various traffic flows." border="0" data-original-height="426" data-original-width="803" height="340" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdGs0qg9gVSGrgoQaV4rtxmrCjrZC1aJ1tGHKZEwzGFmqqy0OXXtEbxtK5V8LkDMUy-xIRNYnh3eMOsQSMknCFo9VKUHJFpL288LwOh3ryf8oZyp3WkoCBHvVLMaSnuixbDYI9_-kgBe4/w640-h340/throu.png" title="Throughput for various traffic flows." width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><p class="MsoListParagraph" style="line-height: 24px; margin-bottom: 0.0001pt; text-indent: -18pt;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;"><span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;">Throughput for various traffic flows<o:p></o:p></span></p><div class="separator" style="clear: both;"><br /></div></td></tr></tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">6.5
Message Sending in Wireless Networks<o:p></o:p></span></b></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 478.8pt;" valign="top" width="958">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Listing 6.4 – Message passing between wireless
nodes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(chan) Channel/WirelessChannel ;# channel type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(prop) Propagation/TwoRayGround ;# radio-propagation model<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(netif) Phy/WirelessPhy ;# network interface type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(mac) Mac/802_11 ;# MAC type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(ifq) Queue/DropTail/PriQueue ;# interface queue type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(ll) LL ;# link layer type<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(ant) Antenna/OmniAntenna ;# antenna model<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(ifqlen) 50 ;# max packet in ifq<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(nn) 2 ;# number of
mobilenodes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set val(rp) DSDV ;# routing protocol<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set ns [new Simulator]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set f [open four.tr w]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns trace-all $f<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set nf [open four.nam w]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns namtrace-all-wireless $nf 670 670<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># set up topography object<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set topo
[new Topography]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$topo load_flatgrid 700 700<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">create-god $val(nn)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> $ns
node-config -adhocRouting $val(rp) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-llType $val(ll) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-macType $val(mac) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-ifqType $val(ifq) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-ifqLen $val(ifqlen) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-antType $val(ant) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-propType $val(prop) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-phyType $val(netif) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-channelType $val(chan) \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> -topoInstance $topo \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-agentTrace ON \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-routerTrace ON \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-macTrace OFF \<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
-movementTrace OFF <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> for {set
i 0} {$i < $val(nn) } {incr i} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> set
node_($i) [$ns node] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
$node_($i) random-motion 0
;# disable random motion<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> }</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Define node movement model<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">puts "Loading connection pattern..."<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Provide initial (X,Y, for now Z=0) co-ordinates
for mobilenodes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$node_(0) set X_ 5.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$node_(0) set Y_ 2.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$node_(0) set Z_ 0.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$node_(1) set X_ 390.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$node_(1) set Y_ 385.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$node_(1) set Z_ 0.0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Now produce some simple node movements<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Node_(1) starts to move towards node_(0)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns at 50.0 "$node_(1) setdest 45.0 40.0
45.0"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Define node initial position in nam<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">for {set i 0} {$i < $val(nn)} {incr i} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> # 20
defines the node size in nam, must adjust it according to your scenario<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> # The
function must be called after mobility model is defined<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> $ns
initial_node_pos $node_($i) 40<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set udp0 [new Agent/UDP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(0) $udp0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#messages that are to be sent<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">array set dbans {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> "Where
are you" "Home"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> "Welcome
to Wireless networks" "yes"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> "Good"
"Welcome" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
"" "Not Found"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">}</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">set udp1 [new Agent/UDP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns attach-agent $node_(1) $udp1<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns connect $udp0 $udp1<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Setting the class allows us to color the packets
in nam.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$udp0 set class_ 0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$udp1 set class_ 1<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># The "process_data" instance procedure
is what will process received data<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># if no application is attached to the agent.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># In this case, we respond to messages of the form
"ping(###)".<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># We also print received messages to the trace
file.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">Agent/UDP instproc process_data {size data} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> global
ns<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> global
udp0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> global
udp1<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> global dbans<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> $self
instvar node_<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> # note
in the trace file that the packet was received<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> $ns
trace-annotate "[$node_ node-addr] received {$data}"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> set
flag1 "0"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> set flag
"0"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> foreach
db [array names dbans] {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> set str3
[string equal $db $data]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> if
{$str3 == "1"} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> set flag
"1"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> set str4
[$node_ node-addr]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> $ns
trace-annotate "Replying correct question for recieved
data:{$data}"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> $ns
trace-annotate "question: $db answer: $dbans($db)"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> set ans
"$dbans($db)" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> switch
$str4 {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> 0
{$ns at 80 "$udp0 send 828 replied:$ans"}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> 1
{$ns at 80 "$udp1 send 828 replied:$ans"}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> 2
{$ns at 80 "$udp2 send 828 replied:$ans"}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
default {puts "I don't know what the number is"}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> }<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> set str5
[string equal $flag $flag1] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> if
{$str5 == "1"} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> $ns
trace-annotate "Answer not found in database"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns at 50.3 "$udp0 send 500 {how are
you}"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns at 70.5 "$udp1 send 828 hi"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"># Tell nodes when the simulation ends<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">#<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">for {set i 0} {$i < $val(nn) } {incr i} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> $ns at
150.0 "$node_($i) reset";<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns at 150.0 "stop"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns at 150.01 "puts \"NS
EXITING...\" ; $ns halt"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">proc stop {} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">
global ns f nf<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> $ns
flush-trace<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> close $f<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> close
$nf<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">puts "Starting Simulation..."<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 10pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">$ns run<o:p></o:p></span></p>
</td>
</tr>
</tbody></table><b><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: large;"><br /></span></span></b><div><span color="windowtext" lang="EN-US" style="line-height: 150%;"><span>Conclusion:</span></span><p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-bidi-font-weight: bold; mso-fareast-font-family: "Times New Roman";">This chapter deals with the basics of wireless adhoc
networks and its simulation in ns2. This chapter shows the wireless networks
with two nodes, energy model enablement and message sending between the nodes.
For most of the 802.11 mac protocols, the same set of node configuration, GOD
object setting, Agent creation, etc will be common. Using this chapter, one can
able to design most of the wireless adhoc networks in ns2.<o:p></o:p></span></p><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com1tag:blogger.com,1999:blog-8826608353769320919.post-10579610090162349282021-10-26T14:44:00.007+05:302021-10-26T14:51:32.666+05:30Wired Networks in NS2 - NS2 Tutorial 5<h1 style="line-height: 150%; margin-bottom: 0.0001pt; text-align: left;"><b style="text-align: right;"><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: x-large;">Wired Networks</span></span></b></h1>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">In this
post:<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l1 level1 lfo1; text-indent: -18pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Introduction to Wired networks<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-list: l1 level1 lfo1; text-indent: -18pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tcl scripts for various wired networks</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Wired
networks are easier to setup as they need a physical link between the nodes and
hence they form a network by having a duplex or simplex link. Also we have seen
an example of a two node network in Chapter 1 that informs how to connect two
nodes in a network with a duplex link.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">This chapter
tells about the various wired network supported in ns2 and examples to showcase
these networks.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">This
wired example sets the shape for the nodes and also sets labels for the node.
Each node can be differentiated using labels like client, server. Etc. There
are 3 shapes supported by ns2, they are hexagon, square and circle. Once the
shape is fixed, the shapes can't be changed during the simulation.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$node shape hexagon</span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Also
the nodes can be colored using the coloring values, there are so many colors
supported by ns and some of them are blue, red, green, orange, magenta, etc.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$node color name</span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">the
following examples depicts three nodes that are either colored,shaped and
labelled. The following network does not have any traffic generation or
simulation. Its just informs the attributes of the node.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Sometimes
the node can be marked with a color and shape with a name. The syntax is <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$node add-mark name color shape <o:p></o:p></span></b></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 478.8pt;" valign="top" width="958">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Listing 4.1 – To set the attributes of the node
like shape, color, label, marking.</span></b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Create global variables <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ns [new Simulator] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#setting nam trace <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set namf [open wired1.nam w] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns namtrace-all $namf <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#open the trace file <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set tracef [open wired1.tr w] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns trace-all $tracef <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set proto rlm <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#setting the color values <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 1 blue <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 2 yellow <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 3 red <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#---------- creating client- router- end server node----------------# <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n0 [$ns node] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n1 [$ns node] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n2 [$ns node] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#establish the link between the nodes <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n0 $n1 2Mb 100ms DropTail <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n1 $n2 200Kb 100ms DropTail <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Label the nodes <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$n0 label Client1" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$n1 label Server" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$n2 label Client2" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#setting the color for nodes <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$n0 color blue <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$n1 color red <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$n2 add-mark pradeep green square <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Shaping the nodes for differentiation <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$n1 shape hexagon <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$n2 shape square <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#finish procedure <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">proc finish {} { <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">global ns tracef namf <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns flush-trace <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">close $tracef <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">close $namf <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">puts "Opening nam..." <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">exec nam wired1.nam & <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">exit 0 <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">} <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Calling finish procedure <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 2.0 "finish" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns run<o:p></o:p></span></p>
</td>
</tr>
</tbody></table><p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
above listing just shows two clients and a server and there was no traffic and
it is just to create a topology and Fig 4.1 shows this<o:p></o:p></span></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMHftH9l4yLjcQI0wzbVEJiQmojsWONULDL3qHf6L2nQwi9v8qW2deGBE15pxrFvqEyL0MBTToBN1AmTWzbvmMYhdsj79rhLqPlUTQudWk1NqMNgc6D1hioLFWXAvwMHg9I9dO4nhH4eo/s1296/41.jpg" style="margin-left: auto; margin-right: auto;"><img alt="A simple Wired network with three nodes" border="0" data-original-height="485" data-original-width="1296" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgMHftH9l4yLjcQI0wzbVEJiQmojsWONULDL3qHf6L2nQwi9v8qW2deGBE15pxrFvqEyL0MBTToBN1AmTWzbvmMYhdsj79rhLqPlUTQudWk1NqMNgc6D1hioLFWXAvwMHg9I9dO4nhH4eo/w640-h240/41.jpg" title="A simple Wired network with three nodes" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;">A simple Wired network with three nodes<br /><br /></span><span><a name='more'></a></span></b></td></tr></tbody></table>
<h2 style="line-height: 150%; margin-bottom: 0.0001pt; text-align: left;"><b><span color="windowtext" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: large;">Tcp Source and the Sink Agent</span></span></b></h2>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">This
example shows the simple Tcp with FTP Traffic. Since in wired networks, Tcp is
a connection oriented transport protocol which needs an acknowledgment for
every packet it sents. The following network shows that. There are 4 nodes, and
two nodes are exchanging packets between them and an intermediate node is
forwarding the packet to the destination node. The performance characteristics
of this network is analysed in the next section. </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
C++ source code relevant to Tcp is available in the ~ns-2.35/tcp/tcp.cc. Also
it involves various parameters during the simulation like congestion window,
duplicate acknowledgement, and sequence no, etc.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Also
this network used a FTP (File Transfer Protocol) for the traffic.</span></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 478.8pt;" valign="top" width="958">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Listing 4.2 – Tcl Script to show the TCP with FTP
Traffic<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Set the simulator <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ns [new Simulator] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Opening the network animation <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set namf [open wired2.nam w] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns namtrace-all $namf</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#open the file for tracing <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set tracef [open wired2.tr w] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns trace-all $tracef</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#creation of wired nodes <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n0 [$ns node] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n1 [$ns node] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n2 [$ns node] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n3 [$ns node]</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#establish the links between the nodes with bandwidth and delay <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n0 $n1 2MB 1ms DropTail <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n1 $n2 2.5MB 1ms RED <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n2 $n3 2MB 1.5ms DropTail <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n3 $n1 12MB 10ms DropTail <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#creating the Tcp source and sink agents <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set tcp [new Agent/TCP] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set sink [new Agent/TCPSink] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#attach the agents to the corresponding nodes <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n0 $tcp <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n2 $sink <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#create the FTP Traffic <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ftp [new Application/FTP] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ftp attach-agent $tcp <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns connect $tcp $sink <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#start the traffic <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 1.0 "$ftp start" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#end the simulation <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 3.0 "finish" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">proc finish {} { <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> global ns namf tracef <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> $ns flush-trace <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> close $namf <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> close $tracef <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> exec nam wired2.nam & <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> exit 0 <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">} <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns run<b><o:p></o:p></b></span></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdDGTiN2ACzPr7zV0m37u6Vq_AlArCR8ZyZBhnm8IgsnsMPV_JWIS1ORG95ENGxiGEPlmHMiILIrTVSQFPNgSZC5edp2K8UtjwbpjBWlyCAx05kfsUzkJgYHT1rxQZWMJeETPZejCjHQA/s696/42.jpg" style="margin-left: auto; margin-right: auto;"><img alt="A Wired network with Four nodes with FTP Traffic" border="0" data-original-height="462" data-original-width="696" height="424" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhdDGTiN2ACzPr7zV0m37u6Vq_AlArCR8ZyZBhnm8IgsnsMPV_JWIS1ORG95ENGxiGEPlmHMiILIrTVSQFPNgSZC5edp2K8UtjwbpjBWlyCAx05kfsUzkJgYHT1rxQZWMJeETPZejCjHQA/w640-h424/42.jpg" title="A Wired network with Four nodes with FTP Traffic" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b style="font-family: "Times New Roman";"><span color="windowtext" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;">A Wired network with Four nodes with FTP Traffic</span></b></td></tr></tbody></table><p></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
Listing 4.2 shows a simple wired network with four nodes that just involves in
a FTP Traffic. The Fig 4.2 shows this.</span></p><p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span></span></p><!--more--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><br /></span><p></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Wired network with various traffic</span></b><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">NS
supports various traffic that may be employed in Tcl scripts to test. Some
examples are <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">•<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">CBR Traffic<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">•<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">FTP Traffic<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">•<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Exponential Traffic<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">•<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Telnet Traffic<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">•<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">SMTP<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">These
traffic can be simulated in TCP or UDP Agents.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
following Listing depicts these traffics. For example, SMTP (Simple Mail
Transfer protocol) traffic is more like exponential traffic and this can be
simulated using Application/Traffic/Exponential.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 478.8pt;" valign="top" width="958">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Listing 4.3 – Tcl Script to show various traffics
in the network</span></b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">There are totally 10 wired nodes that shares duplex links between them.
Four of the links are enabled with ftp, cbr,smtp and telnet traffic. The
following listing shows the simulation with the snapshot of the animation.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Set the global variable<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ns [new Simulator]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#create the file for animation<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set namf [open wired3.nam w]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns namtrace-all $namf<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#create the file for tracing<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set tracef [open wired3.tr w]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns trace-all $tracef<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#creation of nodes using for loop<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">for {set i 0} {$i < 10} {incr i} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> set node($i) [$ns node]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#establishing the duplex links between the nodes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(0) $node(1) 2mb 1ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(2) $node(3) 1mb 10ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(1) $node(6) 3mb 10ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(4) $node(3) 2mb 50ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(8) $node(1) 3mb 25ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(6) $node(4) 1mb 30ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(7) $node(5) 2mb 15ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(8) $node(4) 20mb 4ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(2) $node(5) 2mb 100ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(0) $node(9) 12mb 10ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(0) $node(3) 20mb 14ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $node(9) $node(7) 20mb 4ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#define the procedure for smtp traffic with two nodes as parameters<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">proc traffic_smtp {n0 n1} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">global ns<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set smtpsource [new Agent/UDP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set smtpsink [new Agent/UDP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n0 $smtpsource<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n1 $smtpsink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns connect $smtpsource $smtpsink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set smtp_traffic [new Application/Traffic/Exponential]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$smtp_traffic attach-agent $smtpsource<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$smtp_traffic set burst_time_ 50ms<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$smtp_traffic set idle_time_ 50ms<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$smtp_traffic set rate_ 100k<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$smtp_traffic set packetSize_ 100<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.1 "$smtp_traffic start"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 1.0 "$smtp_traffic stop"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#call the procedure<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">traffic_smtp $node(0) $node(1)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#define the procedure for CBR traffic with two nodes as parameters<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">proc traffic_cbr {n2 n3} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">global ns<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set cbrsource [new Agent/UDP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set cbrsink [new Agent/Null]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n2 $cbrsource<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n3 $cbrsink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns connect $cbrsource $cbrsink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set cbr_traffic [new Application/Traffic/CBR]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$cbr_traffic attach-agent $cbrsource<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$cbr_traffic set interval_ 50<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$cbr_traffic set packetSize_ 50<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 1.0 "$cbr_traffic start"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 2.0 "$cbr_traffic stop"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#call the CBR Traffic procedure<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">traffic_cbr $node(2) $node(3)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#define the procedure for FTP traffic with two nodes as parameters<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">proc traffic_ftp {n1 n6} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">global ns<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ftpsource [new Agent/TCP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ftpsink [new Agent/TCPSink]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n1 $ftpsource<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n6 $ftpsink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns connect $ftpsource $ftpsink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ftp_traffic [new Application/FTP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ftp_traffic attach-agent $ftpsource<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ftp_traffic set interval_ 50<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ftp_traffic set packetSize_ 50<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 2.0 "$ftp_traffic start"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 3.0 "$ftp_traffic stop"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#call the ftp traffic procedure<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">traffic_ftp $node(1) $node(6)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#define the procedure for Telnet traffic with two nodes as parameters<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">proc traffic_telnet {n8 n1} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">global ns<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set telnetsource [new Agent/TCP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set telnetsink [new Agent/TCPSink]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n8 $telnetsource<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns attach-agent $n1 $telnetsink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns connect $telnetsource $telnetsink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set telnet_traffic [new Application/Telnet]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$telnet_traffic attach-agent $telnetsource<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$telnet_traffic set interval_ 0.005<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 3.0 "$telnet_traffic start"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 4.0 "$telnet_traffic stop"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#call the telnet traffic<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">traffic_telnet $node(8) $node(1)<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Trace annotation during the animation. Theese string will be displayed
in the NAM window<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.1 "$ns trace-annotate \"Time: 0.1 SMTP Traffic from
Node 0 to Node 1 ..\""<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 1.0 "$ns trace-annotate \"Time: 1.0 CBR Traffic from
Node 2 to Node 3 ..\""<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 2.0 "$ns trace-annotate \"Time: 2.0 FTP Traffic from
Node 1 to Node 6..\""<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 3.0 "$ns trace-annotate \"Time: 3.0 Telnet Traffic from
Node 8 to Node 1..\""<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#call the procedure finish<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 5.0 "finish"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#creation of finish procedure<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">proc finish {} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> global ns namf tracef<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> $ns flush-trace<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> close $namf<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> close $tracef<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns run<o:p></o:p></span></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> <span></span></span></p><!--more--><p></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZMj4q3_yWE98X6fwuZoIHx844XZRqi9nAhf9LpxA9duMeZM0uB2fWTHoPtW0RKJ2gTg9wBLg43fjKri1azux14uS7sHei_QlZ2ooYoNKH7bR8Q9XA_Zlw9LbSXasTY3mCOXAZiCvSgXY/s1352/52.jpg" style="margin-left: auto; margin-right: auto;"><img alt="Wired network with CBR, SMTP, Telnet and FTP Traffic" border="0" data-original-height="706" data-original-width="1352" height="334" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjZMj4q3_yWE98X6fwuZoIHx844XZRqi9nAhf9LpxA9duMeZM0uB2fWTHoPtW0RKJ2gTg9wBLg43fjKri1azux14uS7sHei_QlZ2ooYoNKH7bR8Q9XA_Zlw9LbSXasTY3mCOXAZiCvSgXY/w640-h334/52.jpg" title="Wired network with CBR, SMTP, Telnet and FTP Traffic" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;">Wired network with CBR, SMTP, Telnet and FTP Traffic</span></b></td></tr></tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
Listing 4.3 shows some new things in ns, they are<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">•<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Different applications like <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 54.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 54pt; mso-layout-grid-align: none; mso-list: l0 level2 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">◦<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">FTP Traffic - Application/FTP<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 54.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 54pt; mso-layout-grid-align: none; mso-list: l0 level2 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">◦<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">CBR Traffic - Application/Traffic/CBR<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 54.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 54pt; mso-layout-grid-align: none; mso-list: l0 level2 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">◦<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">SMTP Traffic - Application/Traffic/Exponential<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 54.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 54pt; mso-layout-grid-align: none; mso-list: l0 level2 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">◦<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Telnet Traffic - Application/Telnet<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">•<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">This script uses the trace-annotate command that
uses to display string during the animation as shown in Fig 4.3<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">•<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">This script also uses procedure with parameters.
Four procedures were used with two parameters as the node names.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; margin: 0cm 0cm 0cm 36pt; mso-layout-grid-align: none; mso-list: l0 level1 lfo2; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: OpenSymbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: OpenSymbol; mso-bidi-language: HI; mso-fareast-font-family: OpenSymbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">•<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Also node creation is done using For loop and the
nodes are named as array values. Ex. node0, node1, etc.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Printing the properties of Tcp Reno Agent</span></b><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
following listing prints the congestion window of the TcpReno agent and plots
it using xgraph. Xgraph is third party software that comes with the ns allinone
package. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 6pt; mso-layout-grid-align: none; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">Congestion window size
is a major factor in predicting the performance of a TCP Network. NS2 handles
the Congestion window using a variable <b><i>cwnd_</i></b> and it can be printed to a
graph and as well printed as values at various intervals of time.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 7.5pt; mso-layout-grid-align: none; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">The following Tcl script
will let you understand the working of the network (TCP Reno Protocol) and also
helps you in plotting the characteristics of Congestion window value.<br />
<!--[if !supportLineBreakNewLine]--><br />
<!--[endif]--><o:p></o:p></span></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 478.8pt;" valign="top" width="958">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">Listing 4.4 – Tcl Script to print the Congestion Window
of TcpReno Agent.</span></b><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">#create simulator<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set ns [new
Simulator] <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">#to create nodes<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set n0 [$ns node]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set n1 [$ns node]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set n2 [$ns node]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set n3 [$ns node]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set n4 [$ns node]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set n5 [$ns node]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># to create the link
between the nodes with bandwidth, delay and queue<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns duplex-link $n0
$n2 2Mb 10ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns duplex-link $n1
$n2 2Mb 10ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns duplex-link $n2
$n3 0.3Mb 200ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns duplex-link $n3
$n4 0.5Mb 40ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns duplex-link $n3
$n5 0.5Mb 30ms DropTail<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># Sending node is 0
with agent as Reno Agent<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set tcp1 [new
Agent/TCP/Reno]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns attach-agent $n0
$tcp1<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># receiving (sink)
node is n4<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set sink1 [new
Agent/TCPSink]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns attach-agent $n4
$sink1<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># establish the
traffic between the source and sink<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns connect $tcp1
$sink1<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># Setup a FTP traffic
generator on "tcp1″<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set ftp1 [new
Application/FTP]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ftp1 attach-agent
$tcp1<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ftp1 set type_
FTP <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># start/stop the
traffic<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns at 0.1 "$ftp1 start"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns at 40.0
"$ftp1 stop"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"> </span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># Set simulation end
time<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns at 50.0
"finish" <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># procedure to plot
the congestion window<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">proc plotWindow
{tcpSource outfile} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"> global ns<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"> set now [$ns now]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"> set cwnd [$tcpSource set cwnd_]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># the data is recorded
in a file called congestion.xg (this can be plotted # using xgraph or
gnuplot. this example uses xgraph to plot the cwnd_<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"> puts
$outfile "$now $cwnd"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"> $ns at [expr $now+0.1] "plotWindow
$tcpSource $outfile"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">set outfile [open "congestion.xg" w]<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns at
0.0 "plotWindow $tcp1 $outfile"<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">proc finish {} {<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"> exec xgraph congestion.xg -geometry
300×300 &<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"> exit 0<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">}<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"># Run simulation <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;">$ns run<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: widow-orphan no-line-numbers; text-autospace: none;"><span color="windowtext" lang="EN-US" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-fareast-font-family: "Times New Roman"; mso-fareast-theme-font: minor-fareast;"> </span></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> <span></span></span></p><!--more--><p></p>
<p align="center" class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-align: center; text-autospace: none;"><br /></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs4ZrGGJxXdNb9I-m_jxDdldx9NoVvQwCevHxfgjgWZB-DGcfjSZmKpVfo44BHw4IaaQwJUF4jQ7O4SX2MUI96afLv2Q60iFbXFz0CJMZGq4RgxfcUwQHk9YDrCLcao1kImOPyWxz_OrI/s624/44.jpg" style="margin-left: auto; margin-right: auto;"><img alt="Congestion window of a Tcp Reno Agent" border="0" data-original-height="624" data-original-width="602" height="640" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjs4ZrGGJxXdNb9I-m_jxDdldx9NoVvQwCevHxfgjgWZB-DGcfjSZmKpVfo44BHw4IaaQwJUF4jQ7O4SX2MUI96afLv2Q60iFbXFz0CJMZGq4RgxfcUwQHk9YDrCLcao1kImOPyWxz_OrI/w618-h640/44.jpg" title="Congestion window of a Tcp Reno Agent" width="618" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><b><span color="windowtext" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;">Congestion window of a Tcp Reno Agent</span></b></td></tr></tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
listing 4.4 has the facility of printing the congestion window in a graph and
Fig 4.4 shows this. As in Fig 4.4, the congestion window is initially at a
value of 1 and increases periodically over a period of time. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></p>
<table border="1" cellpadding="0" cellspacing="0" class="MsoTableGrid" style="border-collapse: collapse; border: none; mso-border-alt: solid windowtext .5pt; mso-padding-alt: 0cm 5.4pt 0cm 5.4pt; mso-yfti-tbllook: 1184;">
<tbody><tr>
<td style="border: 1pt solid windowtext; mso-border-alt: solid windowtext .5pt; padding: 0cm 5.4pt; width: 478.8pt;" valign="top" width="958">
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">Listing 4.5 – Wired network <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"># enable the multicast routing protocol in ns2<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ns [ new Simulator -multicast on] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"># Creating network animation<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set namf [open wired3.nam w] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns namtrace-all $namf<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Open the trace file <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set tracef [open wired3.tr w] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns trace-all $tracef<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#define the multicast routing protocol<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set proto rlm <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#------------COLOR DESCRIPTION---------------# <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 1 dodgerblue <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 2 red <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 3 cyan <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 4 green <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 5 yellow <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 6 black <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 7 magenta <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 8 gold <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns color 9 red <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"># --------- CREATING SENDER - RECEIVER - ROUTER
NODES-----------# <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n1 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n2 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n3 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set n4 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set m1 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set m2 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set m3 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set m4 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set Router1 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set Router2 [$ns node] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set Router3 [$ns node]<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n1 $Router1 1Mb 10ms DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n2 $Router1 500Kb 10ms DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n3 $Router1 750Kb 10ms DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $n4 $Router2 1Mb 10ms DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $m1 $Router1 1Mb 10ms DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $m2 $Router1 1Mb 10ms DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $m3 $Router1 1Mb 10ms DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $m4 $Router3 1Mb 10ms DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $Router2 $Router1 1Mb 10ms
DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $Router2 $Router3 1Mb 10ms
DropTail <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link $Router1 $Router3 1Mb 10ms
DropTail<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"># queue size, beyond this size, the packets will
be dropped<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns queue-limit $Router1 $Router2 20<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns queue-limit $Router1 $Router3 20 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns queue-limit $Router2 $Router1 20 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns queue-limit $Router3 $Router1 25<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"># label the nodes as per their nature of work<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$n1 label Client1" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$n2 label Client2" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$n3 label Client3" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$n4 label Client4" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$m1 label Client5"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$m2 label Client6" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$m3 label Client7" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$m4 label Client8" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$Router1 label Router1" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$Router2 label Router2" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.0 "$Router3 label Router3" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"># defining the shapes for the nodes<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$Router1 shape square <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$Router2 shape square <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$Router3 shape square <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#setting the colors for the links<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link-op $Router1 $Router2 color cyan <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link-op $Router1 $Router3 color cyan <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns duplex-link-op $Router2 $Router3 color cyan<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"># establishing the connection and the agents<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#includes maximum congestion window, the
packetSize and flow id<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set tcp1 [$ns create-connection TCP $n1 TCPSink
$m4 1] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp1 set class_ 1 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp1 set maxcwnd_ 16 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp1 set packetsize_ 4000 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp1 set fid_ 1 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ftp1 [$tcp1 attach-app FTP] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ftp1 set interval_ .005 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.2 "$ftp1 start" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 4.0 "$ftp1 stop" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set tcp2 [$ns create-connection TCP $n2 TCPSink
$m3 1] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp2 set class_ 1 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp2 set maxcwnd_ 16 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp2 set packetsize_ 4000 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp2 set fid_ 2 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ftp2 [$tcp2 attach-app FTP] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ftp2 set interval_ .005 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 0.7 "$ftp2 start" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 4.0 "$ftp2 stop" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set tcp3 [$ns create-connection TCP $n3 TCPSink
$m2 1] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp3 set class_ 1 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp3 set maxcwnd_ 16 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp3 set packetsize_ 4000 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp3 set fid_ 3 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ftp3 [$tcp3 attach-app FTP] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ftp3 set interval_ .005 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 1.2 "$ftp3 start" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 4.0 "$ftp3 stop" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set tcp4 [$ns create-connection TCP $n4 TCPSink
$m1 1] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp4 set class_ 1 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp4 set maxcwnd_ 16 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp4 set packetsize_ 4000 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$tcp4 set fid_ 4 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set ftp4 [$tcp4 attach-app FTP] <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ftp1 set interval_ .005 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 2.5 "$ftp4 start" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 4.0 "$ftp4 stop"<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#define the finish procedure. <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">proc finish {} { <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">global ns namf tracef nf1 <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set NSHOME
"/home/pradeepkumar/ns-allinone-2.35" ;#change path <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set SETFID
"$NSHOME/ns-2.35/bin/set_flow_id" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">set RAW2XG_SCTP
"$NSHOME/ns-2.35/bin/raw2xg-sctp" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns flush-trace<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">close $namf <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">exec perl $SETFID -s rands2.tr | \<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">perl $RAW2XG_SCTP -A -q > Rands2.rands <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">exec xgraph -bb -tk -nl -m -x time -y packets
Rands2.rands & <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns flush-trace <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">close $tracef <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">exit 0
<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">} <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">#Calling finish procedure <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns at 20.0 "finish" <o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><b><span color="windowtext" style="font-family: "Courier New"; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">$ns run<o:p></o:p></span></b></p>
</td>
</tr>
</tbody></table>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
Listing 4.5 uses the following:<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l1 level1 lfo1; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: Symbol; mso-bidi-language: HI; mso-fareast-font-family: Symbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">There are totally 11 nodes, 8 client nodes and 3
router nodes<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l1 level1 lfo1; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: Symbol; mso-bidi-language: HI; mso-fareast-font-family: Symbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The links are colored<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l1 level1 lfo1; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: Symbol; mso-bidi-language: HI; mso-fareast-font-family: Symbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">All the nodes were labelled<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpMiddle" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l1 level1 lfo1; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: Symbol; mso-bidi-language: HI; mso-fareast-font-family: Symbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">They use TCP Agents with FTP Flow with altered
parameters like packetSize_, maximum congestion window specification, rate of
transfer and flow id.<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="line-height: 150%; margin-bottom: 0cm; mso-add-space: auto; mso-layout-grid-align: none; mso-list: l1 level1 lfo1; mso-pagination: none; text-autospace: none; text-indent: -18pt;"><!--[if !supportLists]--><span color="windowtext" style="font-family: Symbol; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-font-family: Symbol; mso-bidi-language: HI; mso-fareast-font-family: Symbol; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The script uses the set_flow_id and raw2xg_sctp
binaries provided by ns2 and it uses perl script to plot the characteristics of
data sent, data drop etc.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
Network Animation window and the related the graphs are shown below.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;">The
following figure shows the data sent, forwarded, received and dropped at all
the links. The graph shows green color as dense dots as data generation is huge
compared to the data forwarded, received or lost.</span></p><p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"><span></span></p><!--more--><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><br /></span><p></p><p class="MsoNormal" style="line-height: 150%; margin-bottom: 0cm; mso-layout-grid-align: none; mso-pagination: none; text-autospace: none;"></p><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKosPT-6RwJaFTp24s8I4Ag3YAxm144Ssk8Ol63mGtNPjrYqhlpB0xdICd9koJ5k0jPOOugqMz6tu1-jDiewOkBL1yzNMROi_pxTIBazfRTJ_cxXOoJh0HaBlbELeSNg4DmyCBGXdCVxY/s652/45.png" style="margin-left: auto; margin-right: auto;"><img alt="Network Animation" border="0" data-original-height="478" data-original-width="652" height="470" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKosPT-6RwJaFTp24s8I4Ag3YAxm144Ssk8Ol63mGtNPjrYqhlpB0xdICd9koJ5k0jPOOugqMz6tu1-jDiewOkBL1yzNMROi_pxTIBazfRTJ_cxXOoJh0HaBlbELeSNg4DmyCBGXdCVxY/w640-h470/45.png" title="Network Animation" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Network Animation</td></tr></tbody></table><br /><table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-p_YswnvPZUcibPQlzInKmzFIm_4Ggl5Ruq6-lXITRMVUMptJ2PYUAshv-jFjILs3XNJfxctv0YshgxnEkctEDsNqkmln8pyq21RFbg2F7zh-y1pdaue8ao3564t9zYOruxivsG3Qt5Y/s1363/46.png" style="margin-left: auto; margin-right: auto;"><img alt="Packet data" border="0" data-original-height="717" data-original-width="1363" height="336" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-p_YswnvPZUcibPQlzInKmzFIm_4Ggl5Ruq6-lXITRMVUMptJ2PYUAshv-jFjILs3XNJfxctv0YshgxnEkctEDsNqkmln8pyq21RFbg2F7zh-y1pdaue8ao3564t9zYOruxivsG3Qt5Y/w640-h336/46.png" title="Packet data" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;">Packet data</td></tr></tbody></table><span color="windowtext" style="font-family: "Times New Roman",serif; font-size: 12pt; line-height: 150%; mso-ansi-language: EN-IN; mso-bidi-language: HI; mso-fareast-font-family: "Times New Roman"; mso-fareast-language: ZH-CN; mso-font-kerning: .5pt;"><br /></span><p></p><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0tag:blogger.com,1999:blog-8826608353769320919.post-36659540463062191982021-10-26T14:35:00.003+05:302021-10-26T14:35:12.112+05:30TCL/TK Programming for NS2 - NS2 Tutorial 4<w:sdt docparttype="Cover Pages" docpartunique="t" id="277458971" sdtdocpart="t">
<h1 style="line-height: 150%; margin-bottom: 0.0001pt; text-align: left;"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: x-large;">Tcl/Tk
Programming</span></span></b></h1>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">In this
post, you may learn<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpFirst" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l2 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12.0pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">To know the basics of Tcl/TK Programming<o:p></o:p></span></p>
<p class="MsoListParagraphCxSpLast" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; mso-add-space: auto; mso-list: l2 level1 lfo3; text-indent: -18.0pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: Symbol; font-size: 12.0pt; line-height: 150%; mso-bidi-font-family: Symbol; mso-fareast-font-family: Symbol;">·<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;">
</span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">To create a Tcl script</span><b style="font-family: "Times New Roman", serif; font-size: 12pt; text-align: right;"><o:p> </o:p></b></p>
</w:sdt>
<p class="MsoNormal" style="line-height: 150%;"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: large;">Tcl
Programming<o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Over the
span of 25 years a simple modular scripting language was developed and modified
or improved by corporates, academia, open source community and web developers.
The code developed and the binary source is free with no strings attached. This
is one of the oldest scripting language still being used for testing the
network equipment like routers, switches, etc. And used in electronic IC
designs and used as a front end tool (testing tool) for Network Simulator 2
(NS2).</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tcl was
created by <b><i>John Ousterhout</i></b> mainly for embedded system applications for its
ability for rapid prototyping, scripted applications and also fir its small or
bigger footprints.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">3.1 Features of Tcl/Tk</span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Rapid Development: </span></b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tcl almost runs 5 to 10X faster than
other scripting languages if it involves GUI, string handling or integration.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Graphical User Interface</span></b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">
Using its Tk toolkit, Tcl provides facilities for creating GUIs that are
incredibly simple yet remarkably powerful.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Cross Platform </span></b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tcl/Tk runs almost same on all operating systems like
Windows, Macintosh, and Linux/Unix platform.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Continuous upgrades: </span></b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Since 1990s Tcl and Tk have been
under continuous and rapid upgrades which makes Tcl/Tk really a reliable and
solid scripting language that can be relied upon.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Deployment </span></b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tcl can be deployed as a single application on a target
machine very easily whereas other dynamic languages makes deployment harder<b>.</b></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Network-aware applications: </span></b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tcl has a wide number of event
driven codes that are helpful in generating events for networked devices like
routers, switches, routing extensions, etc.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Apart from
these features, Tcl also has a vibrant Community that helps developers with
provision of free extensions, plugins and updates. Also Tcl is easy to learn
and all these come free. Tcl/Tk is completely free with even the binary source
can also be modified or upgraded. </span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"> </span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: large;">3.2 Tcl interpreter and Execution</span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Tcl scripts
are usually having extension of .tcl and can be executed using <i>tclsh or wish. </i>In Linux/Unix families,
following is the way to interpret the tcl scripts.</span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><i><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";"># tclsh filename.tcl </span></i><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">The command
wish will be working for GUI and text mode. Sometimes tclsh can be coming along
with version number for example <i>tclsh86.exe</i>
and can be executed as follows</span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span style="font-family: courier;"><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;">C:/> tclsh86 filename.tcl </span></i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">C:/> source filename.tcl</span></span></i><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">Here is the
screenshot of tclsh.</span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"><o:p></o:p></span></p>
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto;"><tbody><tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8HXoWzoa88kOo5g1kB4Q0x6rvSb4gItGd79AIhjlKipPJYGkDUWEpOuof8M4zws_FDa-5Bu6RwIU6e8EHJKbI_akPW_As9U8SrfcFmS5hlx6Vuv0XDMmAYgSxyL2czvaBXU1195c2N3E/s1366/3.1.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img alt="tclsh interpreter" border="0" data-original-height="768" data-original-width="1366" height="360" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi8HXoWzoa88kOo5g1kB4Q0x6rvSb4gItGd79AIhjlKipPJYGkDUWEpOuof8M4zws_FDa-5Bu6RwIU6e8EHJKbI_akPW_As9U8SrfcFmS5hlx6Vuv0XDMmAYgSxyL2czvaBXU1195c2N3E/w640-h360/3.1.png" title="tclsh interpreter" width="640" /></a></td></tr><tr><td class="tr-caption" style="text-align: center;"><p align="center" class="MsoNormal" style="line-height: 24px; margin-bottom: 0.0001pt;"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 24px;">tclsh interpreter</span></b></p></td></tr></tbody></table>
<p align="center" class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; text-align: center;"><span style="font-family: "Times New Roman", serif; font-size: 12pt; text-align: left;">Since this
book is related to Network Simulator 2 (NS2), the commands and the syntax in
this chapter will be related to NS2 and its simulation libraries. However for
the understanding of new developers, bits and pieces of the tcl scripts are
presented.</span></p>
<h2 style="line-height: 150%; margin-bottom: 0.0001pt; text-align: left;"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: large;">3.3 Getting
Started</span></span></b></h2>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Let us go through some basic syntax of Tcl
Programming. The following examples will
give you a general introduction for Tcl Programming.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">The syntax of Tcl is not similar to C or C++, rather
it is simple and straightforward. This chapter will give you a glimpse of the
Tcl syntax used in NS2</span></p><p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span style="font-size: 12pt;"><span style="font-family: courier;">Example
1: “Hello World”</span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span style="font-family: courier;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"># This is an example to demonstrate the Hello World </span></i></b><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">puts “Hello World!”;
#printing Hello World! to the screen</span><span style="font-family: Times New Roman, serif;"><o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">To run this file, <b>tclsh
ex1.tcl, </b>if the operating system is windows then <b>tclsh.exe ex1.tcl. </b><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l1 level1 lfo1; text-indent: -17.95pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">●<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><b><i><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">puts
</span></i></b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">is the command to print anything to screen<b><o:p></o:p></b></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l1 level1 lfo1; text-indent: -17.95pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">●<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">if
comments are to be placed at the end of the statement, then a trailing semi
colon is a must, as shown in the example above.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 0cm; mso-list: l1 level1 lfo1; text-indent: -17.95pt;"><!--[if !supportLists]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: "Times New Roman";">●<span style="font-family: "Times New Roman"; font-size: 7pt; font-stretch: normal; font-variant-east-asian: normal; font-variant-numeric: normal; line-height: normal;"> </span></span><!--[endif]--><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">A
comment always starts with a preceding # symbol.<o:p></o:p></span></p>
<h3 style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><a name="syntax"><span lang="EN-US" style="font-size: 12.0pt; line-height: 150%;"> </span></a>3.3.1 Basic syntax</h3>
<p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US">Tcl scripts are full of<span class="apple-converted-space"> </span><i>commands</i><span class="apple-converted-space"> </span>separated by newlines. A typical
example of Command is given below. <o:p></o:p></span></p>
<pre style="background: white; line-height: 150%;"><code><span lang="EN-US" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 150%;"> </span></code>expr 3 + 10</pre>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="background: white; font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">This command computes the sum of 3
and 10 and returns the result, 13. You can try out this example using tclsh.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">There are different words that are separated by space.
There are four words in this example:<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">expr</span></code>,
<code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">3</span></code>,<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">+</span></code>,
and<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">10</span></code>. The<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">expr</span></code><span class="apple-converted-space"> </span>command is an arithmetic expression,
computes the result of that expression, and returns the result as a string.
Sometimes the same above command can also be represented as</span></p><pre style="background: white; line-height: 150%;"><code><span lang="EN-US" style="font-family: "Times New Roman", serif; font-size: 12pt; line-height: 150%;">expr 3+10</span></code></pre>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">All commands returns results, even if a command has no
results to display, it displays a empty string.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: large;">3.3.2 Assigning
values to Variables</span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">In Tcl, everything is represented as string, but
internally it also represents integers, double, list or some other types. This
enables faster interpretation. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">For this, the assignment command is used in Tcl which
is <code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">set</span></code>. When the set command is dealing with two arguments
as in:</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">set name TclTk</span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">the (name) in the first command references which
stores TclTk in the memory. Set command always returns the contents of the
variable named in the first argument. So in this command, TclTk without quotes
is being stored in the memory which is referenced by the (name) in the first
command.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><code><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: Calibri;">Set</span></code><span class="apple-converted-space"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"> </span></span><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">can
also be invoked with only one argument. When called with just one argument, it
will return the contents of that argument.<o:p></o:p></span></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US">Here's a summary of the<span class="apple-converted-space"> </span></span><code><span lang="EN-US" style="font-size: 10pt; line-height: 150%;">set</span></code><span class="apple-converted-space"><span lang="EN-US"> </span></span><span lang="EN-US">command.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><code><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: Calibri;">set</span></code><span class="apple-converted-space"><b><i><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"> </span></i></b></span><code><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%; mso-fareast-font-family: Calibri;">variableName valueOfVariable</span></code></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">If<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">valueOfVariable</span></code>
is specified, then the contents of the variable<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">variableName </span></code>are set equal to<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">valueOfVariable. (Like the example we have
seen above)</span></code><o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">If<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">variableName
</span></code>consists only of alphanumeric characters, and no parentheses, it
is a scalar variable.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">If<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">variableName
</span></code>has the form<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">variableName
(index)</span></code>, it is a member of an associative array.</span></p><p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span style="font-family: courier; font-size: 12pt;">Example
2: “Variable and Values”</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set Name “I am Tcl”<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set A 10<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">puts $A<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">puts $Name<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set label "The value in A is: "<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">puts "$label $A"</span></span></i></b></p>
<h3 style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span style="font-size: large;"><span lang="EN-US" style="line-height: 150%;">3.3.3 Command substitution</span></span></h3>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Command substitution is a important concept in Tcl
where result of one command argument can be used for another command. Here is
an example<o:p></o:p></span></p>
<pre style="background: white; line-height: 150%;"><br /></pre><pre style="background: white; line-height: 150%;"><code><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"><b>set a 25<i><o:p></o:p></i></b></span></span></code></pre><pre style="background: white; line-height: 150%;"><code><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"><b>set b [expr $a*4]</b></span></span></code></pre>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="background: white; font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">When a<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">[</span></code><span class="apple-converted-space"> </span>appears in a command, Tcl treats
everything between it and the matching<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">]</span></code><span class="apple-converted-space"> </span>as a nested Tcl command. Tcl evaluates
the entire expr $a*4 as a single command and substitutes as a separate command
and another command set b will be holding the value 100. For future reference,
b can used as $b.</span></p>
<h3 style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="line-height: 150%;"><span style="font-size: large;">3.3.4 Quotes and braces</span></span></h3>
<h3 style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="background-attachment: initial; background-clip: initial; background-image: initial; background-origin: initial; background-position: initial; background-repeat: initial; background-size: initial; font-size: 12pt; font-weight: normal; line-height: 150%;">For example,
consider the following script:</span><span lang="EN-US" style="font-size: 12.0pt; font-weight: normal; line-height: 150%;"><o:p></o:p></span></h3>
<pre style="line-height: 150%;"><code><span lang="EN-US" style="background: white; font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set x 10<b><i><o:p></o:p></i></b></span></span></code></pre><pre style="line-height: 150%;"><code><span lang="EN-US" style="background: white; font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set y 20<b><i><o:p></o:p></i></b></span></span></code></pre><pre style="line-height: 150%;"><code><span lang="EN-US" style="background: white; font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set z "$x + $y is [expr $x + $y]"</span></span></code></pre>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="background: white; font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">The
value of z after the evaluation is <code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">10+ 20 is 30</span></code>. Everything command
between the double quotes is passed to the<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">set</span></code><span class="apple-converted-space"> </span>command as a single word. Note that a
command and variable substitutions are performed on the text between the quotes;
and the quotes themselves are not passed to the command. If the quotes in the
above example were absent, the<span class="apple-converted-space"> </span><code><span style="font-family: "Times New Roman",serif; line-height: 150%; mso-ansi-font-size: 12.0pt; mso-bidi-font-size: 12.0pt; mso-fareast-font-family: Calibri;">set</span></code><span class="apple-converted-space"> </span>command would have received 6
arguments, which would be an error.<o:p></o:p></span></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="background: white;">Curly braces provide another way of grouping information into words.
They are different from quotes in that no substitutions are performed on the
text between the curly braces:<o:p></o:p></span></p>
<pre style="line-height: 150%;"><code><span lang="EN-US" style="background: white; font-family: "Times New Roman", serif; font-size: 12pt; line-height: 150%;">set z {$x + $y is [expr $x + $y]}</span></code></pre><pre style="line-height: 150%;"><span lang="EN-US" style="background: white; font-family: "Times New Roman", serif; font-size: 12pt; line-height: 150%;">This command sets variable<span class="apple-converted-space"> </span></span><code><span lang="EN-US" style="background: white; font-family: "Times New Roman", serif; font-size: 12pt; line-height: 150%;">z</span></code><span class="apple-converted-space"><span lang="EN-US" style="background: white; font-family: "Times New Roman", serif; font-size: 12pt; line-height: 150%;"> </span></span><span lang="EN-US" style="background: white; font-family: "Times New Roman", serif; font-size: 12pt; line-height: 150%;">to the value "</span><code><span lang="EN-US" style="background: white; font-family: "Times New Roman", serif; font-size: 12pt; line-height: 150%;">$x + $y is [expr $x + $y]</span></code><span lang="EN-US" style="background: white; font-family: "Times New Roman", serif; font-size: 12pt; line-height: 150%;">".</span></pre>
<h3 style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="line-height: 150%;"><span style="font-size: large;">3.3.5 Looping and Control structures</span></span></h3>
<h3 style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-size: 12.0pt; font-weight: normal; line-height: 150%;">Tcl provides almost all the control structures that were available with
other programming languages. Tcl control structures are commands that take Tcl
scripts as arguments. <o:p></o:p></span></h3>
<p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US">if statements<o:p></o:p></span></b></p>
<p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 5.0pt;"><b><i><span lang="EN-US">if { test1 } {<o:p></o:p></span></i></b></p>
<p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 5.0pt;"><b><i><span lang="EN-US">body…..1<o:p></o:p></span></i></b></p>
<p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 5.0pt;"><b><i><span lang="EN-US">} elseif { test2 } {<o:p></o:p></span></i></b></p>
<p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 5.0pt;"><b><i><span lang="EN-US">Body…..2 <o:p></o:p></span></i></b></p>
<p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 5.0pt;"><b><i><span lang="EN-US">} else {<o:p></o:p></span></i></b></p>
<p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 5.0pt;"><b><i><span lang="EN-US">Body….n<o:p></o:p></span></i></b></p>
<p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 5.0pt;"><b><i><span lang="EN-US">}</span></i></b></p><p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 5.0pt;"><span style="background-color: transparent; font-family: courier; font-size: 12pt;"><br /></span></p><p style="background: white; line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm; margin-left: 36.0pt; margin-right: 0cm; margin-top: 5.0pt;"><span style="background-color: transparent; font-family: courier; font-size: 12pt;">Example
3: Simple Example using if</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">puts "What’s your mark in Scripting
Language"<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">gets stdin marks<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">if {$marks > 90} {<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> puts
"Great, you got S Grade"<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">} elseif {$marks > 50 && $marks < 90} {<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> puts
"Hey You passed the Exam"<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">} else { <o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;"> puts
"You need to improve your marks next time" <o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">}</span><span style="font-family: Times New Roman, serif;"><o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">This code gives a simple example of if statement with
conditional statements. This example also helps understanding that how to get
the input from the user using <b><i>gets stdin</i></b></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">For Loop</span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">The for loop in Tcl takes the same format as of other
languages like <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">for { initialization }{ condition } { increment or
decrement }{<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">body<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">}</span></span></i></b></p><p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span style="font-size: 12pt;"><span style="font-family: courier;">Example 4: Sum to N Terms</span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set x 10<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set sum 0<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">for { set i 0 } { $i <= $x } { incr i } {<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set sum [expr $sum+ $i]<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">}<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">puts $sum<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">The above example <i>displays</i>
the sum of first 10 elements which is 55.</span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">While Loop<o:p></o:p></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">The while loop syntax is as follows:<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">while { condition } {<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Body of the loop<o:p></o:p></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">}</span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">For example, here is a small code that helps in
understanding while loops in a greater way</span></p><p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span style="font-size: 12pt;"><span style="font-family: courier;">Example 5 –
Squaring a number using while loop</span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">set x 10<o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">while { $x < 10 } {<o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">puts [expr $x * $x ]<o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="font-family: courier;">incr x<o:p></o:p></span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span style="font-family: courier;"><b><span lang="EN-US" style="font-size: 12pt; line-height: 150%;">}</span></b><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><o:p></o:p></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Like for and while, there are foreach and for…in loops
are also used in Tcl programming. Since this book is being written for Network
simulator 2 and its simulation objects, the readers are advised to learn more
about Tcl programming in these books [1].</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: medium;">3.3.6 Procedures</span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">A procedure is a block that contains series of
commands. Functions in other programming languages are preferred as Procedures in
Tcl. The Modularity of the program is maintained when procedures are used. Here
are some of the pros of the procedures:<o:p></o:p></span></p>
<ul type="disc">
<li class="MsoNormal" style="line-height: 150%; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Reducing
the code size by avoiding duplication<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: 150%; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Groups
in to simpler tasks rather than complex task<o:p></o:p></span></li>
<li class="MsoNormal" style="line-height: 150%; mso-list: l0 level1 lfo2; mso-margin-bottom-alt: auto; mso-margin-top-alt: auto; tab-stops: list 36.0pt;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Reuse
of code<o:p></o:p></span></li>
</ul>
<p style="line-height: 150%;"><span lang="EN-US">There are user
defined procedures and built in procedures. The keyword <b><i>proc</i></b> is used to define
the user defined keyword.</span></p><p style="line-height: 150%;"><span style="font-size: 12pt;"><span style="font-family: courier;">Example 6 – Tcl
Procedure Example</span></span></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><span style="font-family: courier;"><b><span lang="EN-US">proc display {} { ; </span></b><span lang="EN-US">#This is the line to create a procedure using
the command proc<o:p></o:p></span></span></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><span style="font-family: courier;"><b><span lang="EN-US"> set ns
[expr 1 + 2] ; </span></b><span lang="EN-US"># evaluates
the expression 1 + 2 and assign it to ns<b><o:p></o:p></b></span></span></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><span style="font-family: courier;"><b><span lang="EN-US"> puts
$ns ; </span></b><span lang="EN-US"># display the value
to the screen<b><o:p></o:p></b></span></span></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="font-family: courier;">}<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><span style="font-family: courier;"><b><span lang="EN-US">display; </span></b><span lang="EN-US">#calling the procedure<b><o:p></o:p></b></span></span></p>
<p style="line-height: 150%;"><span lang="EN-US"><span style="font-family: courier;">the display
procedure is called using <b>display </b>as given in the last line of
the code. It is understood that this procedure does not contain any arguments
or parameters.<o:p></o:p></span></span></p>
<p style="line-height: 150%;"><span style="font-family: courier;"><b><span lang="EN-US">Procedure with arguments</span></b><span lang="EN-US"><o:p></o:p></span></span></p>
<p style="line-height: 150%;"><span lang="EN-US"><span style="font-family: courier;">Procedures can
also take arguments. The following examples show the procedure with single
argument.<b><o:p></o:p></b></span></span></p>
<p style="line-height: 150%;"><b><span lang="EN-US"><span style="font-family: courier;">proc hello{f}
{ ; # f is the argument here<o:p></o:p></span></span></b></p>
<p style="line-height: 150%;"><b><span lang="EN-US"><span style="font-family: courier;"> puts “Hello Mr. $f”<o:p></o:p></span></span></b></p>
<p style="line-height: 150%;"><b><span lang="EN-US"><span style="font-family: courier;">}<o:p></o:p></span></span></b></p>
<p style="line-height: 150%;"><b><span lang="EN-US"><span style="font-family: courier;">puts [hello
“Pradeep”]<o:p></o:p></span></span></b></p>
<p style="line-height: 150%;"><b><span lang="EN-US"><span style="font-family: courier;">puts
[hello “Amit”]<o:p></o:p></span></span></b></p>
<p style="line-height: 150%;"><span lang="EN-US"><span style="font-family: courier;">Output.<o:p></o:p></span></span></p>
<p style="line-height: 150%;"><b><span lang="EN-US"><span style="font-family: courier;">Hello
Mr. Pradeep<o:p></o:p></span></span></b></p>
<p style="line-height: 150%;"><b><span lang="EN-US"><span style="font-family: courier;">Hello
Mr. Amit<o:p></o:p></span></span></b></p>
<p style="line-height: 150%;"><span lang="EN-US">Next example
with more than one argument, let us see an example to find out the biggest
among three numbers. So there can be three arguments.<o:p></o:p></span></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">proc biggest { a b c } {<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">if {$a > $b && $a > $c }<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">return $a<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">} elseif {$b > $a && $b > $c} {<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">return $b<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">} else {<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">return $c<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">}<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">set a 10<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">set b 20<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">set c 30<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">set val [biggest $a $b $c]<o:p></o:p></span></span></b></p>
<p style="line-height: 150%; margin-bottom: .0001pt; margin: 0cm;"><b><span lang="EN-US"><span style="color: #2b00fe; font-family: courier;">puts “The biggest of $a, $b and $c is $val”</span></span></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Procedures are the powerful commands in Tcl and it is
very much useful in producing reusable codes that also reduces the code size.</span></p>
<h2 style="line-height: 150%; margin-bottom: 0.0001pt; text-align: left;"><b><span lang="EN-US" style="font-family: "Times New Roman", serif; line-height: 150%;"><span style="font-size: medium;">3.3.7 Working with
Files</span></span></b></h2>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Like other languages, Tcl also has file handling
facility and it can open, read and write to files. <o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Syntax:<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="color: #2b00fe; font-family: courier;"><b>set nf [open file.txt w]<o:p></o:p></b></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="color: #2b00fe; font-family: courier;"><b>puts $nf “This is a simple example to write to a file</b></span></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">The file attribute can be<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">r – Open the file for reading and file should exist.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">r+ - Open the file for reading and writing.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">w – Open the file for writing, and if the file exists
already, it will be overwritten, else a new file will be created.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">w+ - open the file for reading and writing.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">a - open the file for writing. If the file already
exists, the cursor will point to the end of the file, if the file not exists, a
new file will be created.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">a+ - Open the file for reading and writing. If the
file already exists, the cursor will point to the end of the file, if the file
not exists, a new file will be created.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">It is always a good practice to close a file once the
job is done. The following code shows how to close the file. In Tcl
programming, usually all the open handles like files, pipes, any global
variables, etc can be closed at the end of the program.</span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="color: #2b00fe; font-family: courier;">set tracef [open file.dat a]<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="color: #2b00fe; font-family: courier;">puts $tracef “This is an example to show the file
close”<o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><b><i><span lang="EN-US" style="font-size: 12pt; line-height: 150%;"><span style="color: #2b00fe; font-family: courier;">close $tracef</span><span style="font-family: Times New Roman, serif;"><o:p></o:p></span></span></i></b></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"> </span><span style="font-family: "Times New Roman", serif; font-size: 12pt;">The file is opened in the append mode and if the
file.dat is already existing, then the string “This is an example to show the
file close” will be written to the end of the file.</span></p>
<h3 style="line-height: 150%; margin-bottom: 0.0001pt; text-align: left;"><b><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">Conclusion</span></b></h3>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;">This chapter informs the bits and pieces of Tcl
programming to a limited level. Since this book is intended for Tcl files that
are written for network simulation and hence limited information is provided
for Tcl. The readers are advised to read the full-fledged tutorial for Tcl if
they wanted to do extensive programming on Tcl.<o:p></o:p></span></p>
<p class="MsoNormal" style="line-height: 150%; margin-bottom: .0001pt; margin-bottom: 0cm;"><span lang="EN-US" style="font-family: "Times New Roman",serif; font-size: 12.0pt; line-height: 150%;"> </span></p><script async="" src="https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<ins class="adsbygoogle" data-ad-client="ca-pub-6266661353943337" data-ad-format="fluid" data-ad-layout="in-article" data-ad-slot="6306553473" style="display: block; text-align: center;"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script>
<div class="g-ytsubscribe" data-channel="tspradeepkumar" data-count="default" data-layout="full" data-theme="dark"></div><div class="blogger-post-footer"><script async src="//pagead2.googlesyndication.com/pagead/js/adsbygoogle.js"></script>
<!-- linuxasaservice_main_AdSense1_728x90_as -->
<ins class="adsbygoogle"
style="display:inline-block;width:728px;height:90px"
data-ad-client="ca-pub-6266661353943337"
data-ad-slot="9847222411"></ins>
<script>
(adsbygoogle = window.adsbygoogle || []).push({});
</script></div>T S Pradeep Kumarhttp://www.blogger.com/profile/00230848934745389790noreply@blogger.com0