Академический Документы
Профессиональный Документы
Культура Документы
OBJECT:-
To study various network commands such as ping, ipconfig, tracert with its options.
NETWORK:-
A network consists of several computers connected together. The network can be as
simple as a few computers connected in our home or office, or complicated or even the
entire Internet. When our computer is part of a network, we have access to those systems
either directly or through services like mail and the web.
NETWORK COMMANDS
1.) PING:-
Ping is basically an internet program that allow user to verify that particular IP address
exists and can accept requests. The verb ping means the act of using ping utility or
command. This is used to ensure that a host computer we are trying to reach is actually
operating. Eg- If user can’t ping a host-then user is unable to use a File transfer
Protocol(FTP) to send files to host. Ping is also use with a host to see how long it will
take to get a reply back.
Ping operates by sending a packet to a designated address and waiting for a response.
Ping can also refer to the process of sending a message to all the members of a mailing
list requesting an ACK (acknowledgement code). This is done before sending e-mail in
order to confirm that all of the addresses are reachable.
It uses a series of Internet Control Message Protocol (ICMP) Echo messages to
determine:
• Whether a remote host is active or inactive.
• The round-trip delay in communicating with the host.
• Packet loss.
The ping command first sends an echo request packet to an address, and then waits for a
reply. The ping is successful only if:
• The echo request gets to the destination.
• The destination is able to get an echo reply back to the source within a predetermined
time called a timeout.The default value of this time out is two seconds on Cisco routers.
How to start and go to command prompt:-
START->RUN
Syntax:-
Ping [-t] [-a] [-n count] [-l size] [-f] [-i TTL] [-v TOS]
[-r count] [-s count] [[-j host-list] | [-k host-list]]
[-w timeout] destination-list
OUTPUT:-
Output of ping is-
Time-to-live (TTL) is a value in an Internet Protocol (IP) packet that tells a network
router whether or not the packet has been in the network too long and should be
discarded.
Options:-
2.) IPCONFIG:-
It is used to check IP address, Physical address, and other details of the system. It is run
from MS_DOS shell to display the network settings currently assigned to a system.
It can verify network settings and network connectivity.
Syntax
ipconfig [/all][/renew [Adapter]] [/release [Adapter]] [/flushdns] [/displaydns]
[/registerdns] [/showclassid Adapter] [/setclassid Adapter [ClassID]]
OUTPUT:-
Output of ipconfig/all
Options:
/showclassid Displays all the DHCP class IDs allowed for adapter.
3.) TRACERT:-
It is used to trace the route for domain name and IP address. It gives the number of
packets through which the packets goes to reach the domain name. It is used for trouble
shooting in the case of large network. Tracert uses the IP TTL field and ICMP error
message to determine the route from one host to another through a network.
Syntax
Options:
-d Avoids dissolving addresses to hostname (avoids performing a DNS lookup)
This can speed up the display of tracert results.
-h Specifies maximum number of hops in path to search for target.
OUTPUT:-
Output of tracert and tracert –d
PRACTICAL NO-2
OBJECT:-
To study network simulator and understanding of object tool command language .
NETWORK SIMULATOR:-
The increasing demand for cyber network knowledge has introduced a new solution for
network simulation known as “Network Simulation”.This function offers a simulated
networking environment among devices to reduce problems in the development of real
devices(pc,hubs,router…) environment for a networking experiment.It simulates both
wired and wireless networks.
NS-2 is a discrete event simulator targeted at networking research.NS-2 development is
supported through DARPA with SAMAN and through NSF with CONSER both in
collaboration with other researchers.NS-2 has provided substantial contribution from
other researchers including wireless UCB daedelus,Sun Microsystems.
Network protocol stack are written in C++ language. The NS-2 simulation utilizes the
TCL to build simulation scenarios.We use OTcl (Object Tool Command Language) for
specifying scenarios and events and constructing commands and configuring interfaces. It
is a Open Source, that means it allows the users to modify, rebuilt their own design of
complements, and build own components.Along with this features the nam (Network
Animator )was provided for user friendly visualization of the flow of NS-2 messages as
well as the simulation of entire networking system..NS-2 can only developed in a
environment of UNIX(SunOS,Linux,Solaris).Cygwin is a LINUX like environment for
windows.
$ns color fid color: is used to set color of the packets for a flow specified by the flow
id(fid) . This member function of "Simulator" object is for the NAM display, and has no
effect on the actual simulation.eg-$ns color 1 Blue.
Set nf [open out.nam w]:-This line sets out.nam opened as nf .Along with this open a
nam file for recording.
Proc finish {} is called after this simulation is over by the command $ns at 5.0 "finish".
In this function, post-simulation processes are specified.
Eg-proc finish {} {
global ns nf
$ns flush-trace
Close $nf
#execute nam trace file
exec nam out.nam &
exit 0
}
5. Creating nodes
Set n0 [$ns node] The member function node creates a node. A node in NS is compound
object made of address and port classifiers. Users can create a node by separately creating
an address and a port classifier objects and connecting them together. However, this
member function of Simulator object makes the job easier.
N N N
0 1 2
6. Creating link
$ns duplex-link node1 node2 bandwidth delay queue-type: creates two simplex links
of specified bandwidth and delay, and connects the two specified nodes. In NS, the output
queue of a node is implemented as a part of a link, therefore users should specify the
queue-type when creating links.
This line tells the simulator object to connect the nodes n0 and n1 with a duplex link with
the bandwidth.1Megabit, a delay of 10ms and a DropTail queue.
7. $ns queue-limit node1 node2 number: This line sets the queue limit of the two
simplex links that connect node1 and node2 to the number specified.
9. UDP communication
In UDP communication, data is flows from UDP agent to Null agent.
#Create a UDP agent and attach it to node n0
set udp0 [new Agent/UDP]
$ns attach-agent $n0 $udp0
# create a null agent which act as traffic sink and attach it to node n1
set null0 [new Agent/Null]
$ns attach-agent $n1 $null0
# connect two agents with each other
$ns connect $udp0 $null0
$ns at time “string”: This member function of a Simulator object makes the scheduler to
schedule the execution of the specified string at given simulation time.
For example, $ns at 1.0 “$cbr0 start” will make the scheduler call a start member
function of the CBR traffic source object, which starts the CBR to transmit data. In NS,
usually a traffic source does not transmit actual data, but it notifies the underlying agent
that it has some amount of data to transmit, and the agent, just knowing how much of the
data to transfer, creates packets and sends them.
$ns at 1.0 “$cbr0 start”
$ns at 5.0 “finish"
13. Run simulator
Network Terminology:
1) IP Address : Internet Address, the identifying number that enables any computer on
the Internet to find any other computer on the network. It consists of four sets of numbers
separated by periods—for example, 123.456.78.90. The Internet is the interconnection of
many individual networks. So the IP is basically the set of rules for one network
communicating with any other. Each network must know its own address on the Internet
and that of any other networks with which it communicates. The four numbers in an IP
address are called octets.
2) Subnet mask : A sub network, or subnet, describes networked computers and devices
that have a common, designated IP address routing prefix. Subnetting is used to break the
network into smaller more efficient subnets to prevent excessive rates of Ethernet packet
collision in a large network. A subnet mask allows you to identify which part of an IP
address is reserved for the network, and which part is available for host use. Knowing the
subnet mask can allow you to easily calculate whether IP addresses are on the same
subnet, or not.
4) DNS Server: (Domain Name System) This is a server that translates domain names
into IP addresses. Because domain names are alphabetic, they're easier to remember. The
Internet however, is really based on IP addresses. Every time you use a domain name,
therefore, a DNS service must translate the name into the corresponding IP address. For
example, the domain name http://www.example.com/ might translate to 198.105.232.4.
The DNS system is, in fact, its own network. If one DNS server doesn't know how to
translate a particular domain name, it asks another one, and so on, until the correct IP
address is returned.
Class C IP addresses
Since networks vary in size, there are four different address formats or classes to consider
when applying for a network number:
• Class A addresses are for large networks with many devices.
• Class B addresses are for medium-sized networks.
• Class C addresses are for small networks (fewer than 256 devices).
• Class D addresses are multicast addresses.
Class C addresses are commonly used for small to mid-size businesses. IP addresses with
a first octet from 192 to 223 are part of this class. Class C addresses also include the
second and third octets as part of the Net identifier. The last octet is used to identify each
host. This means that there are 2,097,152 (221) Class C networks each with 254 (28 -2)
possible hosts for a total of 536,870,912 (229) unique IP addresses. All Class C
addresses, for example, have the leftmost three bits set to '110', but each of the remaining
29 bits may be set to either '0' or '1' independently (as represented by an x in these bit
positions):
Step1:
• Select Properties
Step-II
Window appears.
.Step-III
202.41.97.135
PRACTICAL
NO-4
OBJECT: To prepare a
script file for NS
application by creating
four nodes and to
establish link between the
nodes.
PROGRAM CODE:
# create a new simulator
set ns [new Simulator]
PRACTICAL NO-5
OBJECT: To create four nodes ,UDP agent,CBR traffic ,duplex link and attach these to
sources.
PROGRAM CODE:
# create a new simulator
set ns [new Simulator]
#open name trace file
set nf [open out.nam w]
$ns namtrace-all $nf
# create afinish procedure with defination
proc finish {} {
global ns nf
$ns flush-trace
close $nf
#execute name trace file
exec nam out.nam &
#exit
exit 0
}
#create four nodes
#create two udp agent and attach to node zero ,node one
set udp0 [new Agent/UDP]
$udp0 set class_ 1
$ns attach-agent $n0 $udp0
set udp1 [new Agent/UDP]
$udp1 set class_ 2
$ns attach-agent $n1 $udp1
PRACTICAL NO-6
OBJECT: Monitor the queue for different scheduling event and queuing management
system.
PROGRAM CODE:
# create a new simulator
set ns [new Simulator]
#open name trace file
set nf [open out.nam w]
$ns namtrace-all $nf
# create afinish procedure with defination
proc finish {} {
global ns nf
$ns flush-trace
close $nf
#execute name trace file
exec nam out.nam &
#exit
exit 0
}
#create four nodes
OBJECT:To create five nodes and perform dynamic data flow routing.
PROGRAM CODE:
#Create a simulator object ns
set ns [new Simulator]
#Connect the traffic source udp(0) with the traffic sink null0
$ns connect $udp0 $null0
#Schedule events for the CBR agent and the network dynamics
$ns at 0.5 "$cbr0 start"
OBJECT: WAP to create 2 routers r1, r2 . attach nodes s1, s2 to r1 and nodes rc1, rc2
to r2.
PROGRAM CODE:
# create simulator
set ns [new Simulator]
#create 2 routers
set r1 [$ns node]
set r2 [$ns node]
#crate 4 nodes
set s1 [$ns node]
set s2 [$ns node]
set rc1 [$ns node]
set rc2 [$ns node]
# orientation
$ns duplex-link-op $r1 $s1 orient left-up
$ns duplex-link-op $r1 $s2 orient left-down
$ns duplex-link-op $r1 $r2 orient right
$ns duplex-link-op $r2 $rc1 orient right-up
$ns duplex-link-op $r2 $rc2 orient right-down
#cbr traffic source made and packet size and interval defined
set cbr0 [new Application/Traffic/CBR]
$cbr0 set packetSize_ 500
$cbr0 set interval_ 0.005
$cbr0 attach-agent $udp0
# crating 6 nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
OBJECT: Study of Rj-45 connector .Make a straight through cable, crossover cable.
The 10/100 Ethernet ports use standard Rj-45 connectors and Ethernet pinouts with
internal crossovers, as indicated by an x in the port name.These ports have their
transmit(TD) and receive(RD) signals internally crossed so that a straight-through cable
and adapter can be attached to the port.
When connecting the 10/100 ports to compatible servers and workstations, we must use a
straight-through cable wired for 10BaseT and 100BaseTX.when connecting to other
switches or repeaters,ensure that we use a crossover cable.
10/100 pinout
Pin Label
1 RD+
2 RD-
3 TD+
4 NC
5 NC
6 TD-
7 NC
8 NC