0% found this document useful (0 votes)
18 views4 pages

NCTUNS Experiment 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views4 pages

NCTUNS Experiment 2

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

0 Experiment-2

TITLE:
Simulate a four node point-to-point network with the links connected as follows: n0–n2, n1–n2 and n2–n3. Apply TCP
agent between n0-n3 and UDP between n1-n3. Apply relevant applications over TCP and UDP agents changing the
parameter and determine the number of packets sent by TCP / UDP.

1.1 Learning Objectives

To understand the difference between TCP and UDP protocols.

1.2 Aim

 Simulation of TCP and UDP protocols using NCTUns


 Compare throughput of TCP and UDP protocols

1.3 Material / Equipment Required

 Laptop with VMware tool.


 NCTUns tool
 Word processor

1.4 Theory / Hypothesis

The Transmission Control Protocol (TCP) is one of the core protocols of the Internet protocol suite TCP is one of the
two original components of the suite, complementing the Internet protocol (IP), and therefore the entire suite is
commonly referred to as TCP/IP. TCP provides reliable, ordered delivery of a stream of octets from a program on one
computer to another program on another computer. TCP is the protocol used by major Internet applications such as the
world wide web, email and file transfer. Other applications, which do not require reliable data stream service, may use
the User datagram Protocol (UDP), which provides a Datagram service that emphasizes reduced latency over reliability.
The User Datagram Protocol (UDP) is one of the core members of the Internet protocol suite, the set of network
protocols used for the Internet. With UDP, computer applications can send messages, in this case referred to as
datagrams, to other hosts on an Internet protocol(IP) network without requiring prior communications to set up special
transmission channels or data paths. UDP uses a simple transmission model with a minimum of protocol mechanism. It
has no handshaking dialogues, and thus exposes any unreliability of the underlying network protocol to the user's
program. As this is normally IP over unreliable media, there is no guarantee of delivery, ordering or duplicate
protection. UDP provides check sum for data integrity, and port numbers for addressing different functions at the source
and destination of the datagram. UDP is suitable for purposes where error checking and correction is either not
necessary or performed in the application, avoiding the overhead of such processing at the network interface level.
Time-sensitive applications often use UDP because dropping packets is preferable to waiting for delayed packets,
which may not be an option in a real-time system. If error correction facilities are needed at the network interface level,
an application may use the TCP which are designed for this purpose.

1.5 Procedure / Program / Activity


Step1: Drawing topology
1. Select/click the HOST icon on the tool bar and click the left mouse button on the editor, to place a host on the
editor. Repeat the above procedure and place two other hosts “HOST2” and “HOST3” on the editor.
2. Select/click the HUB (or SWITCH) icon on the tool bar and click the left mouse button on the editor, to place
a HUB (or SWITCH) on the editor.
3. Click on the LINK icon on the tool bar and connect HOST1 to HUB, HOST2 to HUB and HUB to HOST3
4. Click on the “E” icon on the tool bar to save the current topology e.g: file2.tpl (Look for the ******.tpl
extension.)
NOTE: Changes cannot / (should not) be done after selecting the “E” icon.

Step2: Configuration
1. Double click the left mouse button while cursor is on HOST1 to open the HOST window.
2. Select Add button on the HOST window to invoke the command window and provide the following command
in the command text box.
stcp –p 7000 –l 1024 1.0.1.3 (for TCP start time 0.0 and end time 20.0)
3. Click OK button on the command window to exit
4. Click NODE EDITOR Button on the HOST window and select the MAC tab from the modal window that
pops up.
5. Select LOG STATISTICS and select check box for output throughput in the MAC window
6. Click OK button on the MAC window to exit and once again click on the OK button on the HOST window to
exit.
7. Double click the left mouse button while cursor is on HOST2 to open the HOST window.
8. Select Add button on the HOST window to invoke the command window and provide the following command
in the command text box.
stg –u 1024 100 1.0.1.3 (for UDP start time 21.0 and end time 40.0)
9. Click OK button on the command window to exit
10. Click NODE EDITOR Button on the HOST window and select the MAC tab from the modal window that
pops up.
11. Select LOG STATISTICS and select check box for output throughput in the MAC window
12. Click OK button on the MAC window to exit and once again click on the OK button on the HOST window to
exit.
13. Double click the left mouse button while cursor is on HOST3 to open the HOST window.
14. Select Add button on the HOST window to invoke the command window and provide the following command
in the command text box.
rtcp –p 7000 –l 1024 (for TCP start time 0.0 and end time 20.0)
15. Click OK button on the command window to exit.
16. Also add the following common on HOST3
rtg –u –w log1 (for UDP start time 21.0 and end time 40.0)
17. Click NODE EDITOR Button on the HOST window and select the MAC tab from the modal window that
pops up.
18. Select LOG STATISTICS and select check box for input and output throughput in the MAC window
19. Click OK button on the MAC window and once again click on the OK button on the HOST window to exit.

Step3: Simulate

1. Click “R” icon on the tool bar


2. Select Simulation in the menu bar and click/ select RUN in the drop down list to execute the simulation.
3. To start playback select “►” icon located at the bottom right corner of the editor.
4. To view results, Open input and output throughput log files from file2.results folder in separate word
processor.
Caution: file2 is the hypothetical name given to this simulation. (Refer Step 1.4)

1.6 Block / Circuit / Model / Reaction Diagram

Readings:
1. simplex with defualt settings, by changing bw, by changing quaue size, by changing BER
Repeat for
2. half duplex
3. full duplex
1.8 Outcome

Students understood how TCP and UDP differ in packet transmission behavior under changing parameters.
Also learnt how application settings and network conditions influence packet counts in each protocol.

You might also like