Uploaded by nilay141

Computer network

advertisement
IT344 Computer Network
18DIT056
Practical-1
Aim: Demonstrate the connection between two LAN connections with one router using cisco packet
tracer.
Practical:
Network is being ready
Network is ready
#Router configuration
DEPSTAR-IT
1
IT344 Computer Network
18DIT056
Fast ethernet port 0/0 used to connect to network of 10.0.0.0/24
Fast ethernet port 0/1 used to connect to network of 11.0.0.0/24
DEPSTAR-IT
2
IT344 Computer Network
18DIT056
Router connected to different network
using fast ethernet port
Ping in same network
From pc 10.0.0.2 -> 10.0.0.1
DEPSTAR-IT
3
IT344 Computer Network
18DIT056
Ping from network 1 to network 2 using
From pc 10.0.0.2 to 11.0.0.1
Conclusion: In this practical we have made two network and connect them using a router and seen if
messages travel from one network to another.
DEPSTAR-IT
4
IT344 Computer Network
18DIT056
Practical-2
Aim: Demonstrate the configuration of VLAN (Virtual LAN) using cisco packet tracer
Practical:
Network is being ready
Network is ready
DEPSTAR-IT
5
IT344 Computer Network
18DIT056
Adding VLAN port in VLAN database
Added port 9,11 and 22
Changing VLAN number from 1 to 11
DEPSTAR-IT
6
IT344 Computer Network
18DIT056
Changing VLAN number from 1 to 9
Changing VLAN number from 1 to 22
DEPSTAR-IT
7
IT344 Computer Network
18DIT056
After Changing VLAN port in a switch
Ping in same VLAN
From pc 200.0.0.1 -> 200.0.0.2
DEPSTAR-IT
8
IT344 Computer Network
18DIT056
Ping in different VLAN
From pc 201.0.0.1 -> 202.0.0.1
Conclusion: In this practical we have made VLAN(virtual LAN) in a switch and made the efficient
use of the switch and seen the message transfer from one VLAN to another which is not possible and
with that we confirmed that VLAN is setup in a switch.
DEPSTAR-IT
9
IT344 Computer Network
18DIT056
Practical-3
Aim: Demonstrate the static routing configuration between 3 routers using cisco packet tracer
Practical:
Network is being ready
Network is ready for use
#Port configuration
DEPSTAR-IT
10
IT344 Computer Network
18DIT056
For router0 configuring Fast Ethernet 0/0 and serial 0/0/0
After configuration of port in router0
DEPSTAR-IT
11
IT344 Computer Network
18DIT056
For router1 configuring Fast Ethernet 0/0 and
serial 0/0/0 and serial 0/0/1
After configuration of port in router1
DEPSTAR-IT
12
IT344 Computer Network
18DIT056
For router2 configuring Fast Ethernet 0/0 and serial 0/0/0
After configuration of port in router2
DEPSTAR-IT
13
IT344 Computer Network
18DIT056
#Routing and Routing table
Routing in Router2 so it can access to 10.0.0.0 and 20.0.0.0
Routing in Router1 so it can access to 10.0.0.0 and 30.0.0.0
Routing in Router0 so it can access to 20.0.0.0 and 30.0.0.0
DEPSTAR-IT
14
IT344 Computer Network
18DIT056
Routing table for router0 two new route is added
after routing to access 20.0.0.0 and 30.0.0.0
Routing table for router1 two new route are
been added after routing to access
10.0.0.0 and 30.0.0.0
Routing table for router2 three new route
are been added after routing to access
10.0.0.0 and 20.0.0.0
DEPSTAR-IT
15
IT344 Computer Network
18DIT056
#data transfer
Ping to 20.0.0.1 and 30.0.0.1 after routing
From pc0 10.0.0.1 -> pc2 20.0.0.1
From pc0 10.0.0.1 -> pc4 20.0.0.1
DEPSTAR-IT
16
IT344 Computer Network
18DIT056
Ping to 30.0.0.1 and 10.0.0.2 after routing
From pc2 20.0.0.1 -> pc4 30.0.0.1
From pc2 20.0.0.1 -> pc3 10.0.0.2
DEPSTAR-IT
17
IT344 Computer Network
18DIT056
Ping to 10.0.0.1 and 20.0.0.1 after routing
From pc4 30.0.0.1 -> pc0 20.0.0.1
From pc4 30.0.0.1 -> pc2 20.0.0.1
Conclusion: In this practical we have learned about the concept of routing and how to transfer data
through router after routing.
DEPSTAR-IT
18
IT344 Computer Network
18DIT056
Practical-4
Aim: Demonstrate the Dynamic routing configuration using RIP and OSPF protocol using cisco packet
tracer
Theory:
Dynamic Routing - Dynamic Routing is a network routing procedure, which facilitates the routers to pick
and choose the routing paths depending on the logical changes happening in the network structure in the
real-time. This is opposite to the typical traditional static network routing. This is an automated routing
technique that requires very less administration and supervision. Various protocols used in this routing
method are Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway
Protocol (BGP), and Enhanced Interior Gateway Routing Protocol (EIGRP).
1. OSPF (Open Shortest Path First) - It is a very famous dynamic routing protocol that is being
used in today’s world. OSPF is also an open protocol to ensure that any router or even server
operating system is able to run this protocol. It selects the best route by making use of cost as its
metric. It is also considered as a complete-featured routing protocol and also it can be complex,
however, it can also scale to any size in the network.
2. RIP (Routing Information Protocol) - RIP is considered a protocol that is an open-source.
Version 2 of it is the latest one that you should be using today since it provides VLSM, that is,
Variable Length Subnet Mask support. It is simplest as well as the easiest protocol of routing to
configure, although it also has got lesser features as compared to OSPF. It is restricted to routing
for the network having less than 15 hops. This protocol works quite well for a small network that
doesn’t think of expanding largely. Another great feature about it is that it is generally supported
by the smallest routers and also the firewalls.
For RIP
Topology:
DEPSTAR-IT
19
IT344 Computer Network
Step of configuration:
•
•
•
18DIT056
First step is to create the topology. For that click on the devices and drop on workplace and connect all
the devices with the necessary cables.
Provide the IP address to all the connected PC by clicking on the PC and selecting desktop tab in that IP
configuration option
Next step is to configure the Router
✓ Click on Router and go to CLI tab
✓ To get in to configuration mode, write router>enable
✓ To configure the terminal, write Router # configure terminal
✓ Write interface [fa 0/0 or se 2/0 or se 3/0] that u want to configure
✓ Give ip address using => ip address 10.0.0.1 255.0.0.0
✓ Then -> no shut which set up the connection
✓ The exit and do for another port.
✓ After doing for all the ports
✓ Use router rip to add the other network in rip pool.
For router 0 configuration and setting up routing using rip
Router>enable
Router#
Router#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int fa 0/0
Router(config-if)#ip ad 10.0.0.1 255.0.0.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up
Router(config-if)#exit
Router(config)#int se 2/0
Router(config-if)#ip ad 192.0.0.1 255.255.255.0
Router#
%SYS-5-CONFIG_I: Configured from console by console
Router(config)#int se 2/0
Router(config-if)#ip ad 192.0.0.1 255.255.255.0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
Router(config-if)#exit
Router(config)#int se 3/0
Router(config-if)#ip ad 191.0.0.1 255.255.255.0
Router(config-if)#no shut
%LINK-5-CHANGED: Interface Serial3/0, changed state to down
Router(config-if)#exit
Router(config)#
Router(config)#router rip
Router(config-router)#network 10.0.0.0
Router(config-router)#network 191.0.0.0
Router(config-router)#network 192.0.0.0
Router(config-router)#exit
DEPSTAR-IT
20
IT344 Computer Network
18DIT056
For router 1 configuration and setting up routing using rip
DEPSTAR-IT
21
IT344 Computer Network
18DIT056
For router 2 configuration and setting up routing using rip
Checking network:
To check the connections are working properly or not drop on package on the one PC0 of LAN 1 i.e.
10.0.0.0 and receive it from the PC2 of LAN 2 i.e. 20.0.0.0
DEPSTAR-IT
22
IT344 Computer Network
18DIT056
To check the connections are working properly or not drop on package on the one PC3 -> PC1 i.e.
20.0.0.3 -> 10.0.0.3
For OSPF
Topology:
Step of configuration:
•
•
•
First step is to create the topology. For that click on the devices and drop on workplace and connect all
the devices with the necessary cables.
Provide the IP address to all the connected PC by clicking on the PC and selecting desktop tab in that IP
configuration option
Next step is to configure the Router
DEPSTAR-IT
23
IT344 Computer Network
✓ Click on Router and go to CLI tab
✓ To get in to configuration mode, write router>enable
✓ To configure the terminal, write Router # configure terminal
✓ Write interface [fa 0/0 or se 2/0 or se 3/0] that u want to configure
✓ Give ip address using => ip address 10.0.0.1 255.0.0.0
✓ Then -> no shut which set up the connection
✓ The exit and do for another port.
✓ After doing for all the ports
✓ After doing that we will setup OSPF algorithm for routing.
18DIT056
✓ Write router ospf id[like 1,2,…]
✓ Then write => network wildmask address[compliment of subnet mask address] area 0
For router 0
For router 1
For router 2
Checking network:
DEPSTAR-IT
24
IT344 Computer Network
18DIT056
From 10.0.0.2 to 20.0.0.2
From 20.0.0.3 to 10.0.0.3
Conclusion: In this practical we learned about dynamic routing and routing algorithm like RIP and
OSPF.
DEPSTAR-IT
25
IT344 Computer Network
18DIT056
Practical-5
Aim: Demonstrate the EIGRP and BGP protocol configuration using cisco packet tracer
Theory:
EIGRP (Enhanced Interior Gateway Routing Protocol)
It is considered as a proprietary protocol for Cisco. Just for your information, just the Cisco devices make use of
EIGRP. It is a completed-featured protocol just like OSPF. It has got some amazing features, but until you make
sure that you are going to have a Cisco network, the use of open protocol (OSPF) is recommended. EIGRP has
replaced IGRP which was its predecessor. The metric that is needed to select the best route through EIGRP is
calculated by the use of a formula that takes into account bandwidth, reliability, delay of the link and also load.
BGP (Border Gateway Protocol)
BGP is considered as the routing protocol of the Internet. It is also Exterior Gateway Protocol, that is, EGP which
means that BGP is used by routers making decisions of routing on the Internet. If your home has got a connection
to the Internet then you don’t really need BGP or even need to run it. In case the router has got more than one
dedicated connection to, you might require running. It is a path-vector protocol which implies that it can select the
best route as compared to other routing protocols. BGP makes use of the “AS-PATH” as the routing metric and also
it selects the route which has got the shortest path through the entire Internet.
For EIGRP
Topology:
Step of configuration:
•
•
•
First step is to create the topology. For that click on the devices and drop on workplace and connect all
the devices with the necessary cables.
Provide the IP address to all the connected PC by clicking on the PC and selecting desktop tab in that IP
configuration option
Next step is to configure the Router
✓ Click on Router and go to config tab and configure router from there
✓ For following topology Fast Ethernet 0/0 and serial 2//0 are being used of each router
✓ After configuring them open cli and establish Enhanced Interior Gateway Routing Protocol for
each router
✓ For that open cli and in configure mode type => route eigrp 1
✓ The provide ip of the direct connections that are made to router.
DEPSTAR-IT
26
IT344 Computer Network
18DIT056
For router 9
For router 10
For router 11
DEPSTAR-IT
27
IT344 Computer Network
18DIT056
For router 12
Checking network:
Ping from 10.0.0.2 to 20.0.0.3
Tracert 10.0.0.3 from 20.0.0.2
DEPSTAR-IT
28
IT344 Computer Network
18DIT056
For BGP
Topology:
Step of configuration:
•
•
•
First step is to create the topology. For that click on the devices and drop on workplace and connect all
the devices with the necessary cables.
Provide the IP address to all the connected PC by clicking on the PC and selecting desktop tab in that IP
configuration option
Next step is to configure the Router
✓ Click on Router and go to config tab and configure router from there.
DEPSTAR-IT
29
IT344 Computer Network
18DIT056
✓ The make the looback network from router 0
✓ Then set the router-id for each router (router0,1and 2 respectively.)
Router 0
✓
Router 1
Router 2
✓ Set up the neighbor configuration for router 0,1 and 2.
Router 0
Router 1
Router 2
✓ Link the loopback network to router 0
DEPSTAR-IT
30
IT344 Computer Network
18DIT056
✓ Loopback network is automatically linked with router 1 and 2 as they are
connected to router 0.
Router 0
Router 1
Router 2
Checking network:
Conclusion: In this practical we learned about routing algorithm like EIGRP and BGP
DEPSTAR-IT
31
IT344 Computer Network
18DIT056
Practical-6
Aim: Demonstrate the static and dynamic configuration of NAT using cisco packet tracer.
Theory:
Network Address Translation (NAT) is the process where a network device, usually a firewall, assigns
a public address to a computer (or group of computers) inside a private network. The main use of NAT
is to limit the number of public IP addresses an organization or company must use, for both economy
and security purposes.
NAT can be used to allow selective access to the outside of the network, too. Workstations or other
computers requiring special access outside the network can be assigned specific external IPs using NAT,
allowing them to communicate with computers and applications that require a unique public IP address.
Again, the firewall acts as the intermediary, and can control the session in both directions, restricting
port access and protocols.
Topology:
Step of configuration:
•
First step is to create the topology. For that click on the devices and drop on workplace and connect
all the devices with the necessary cables.
•
Provide the IP address to all the connected PC by clicking on the PC and selecting desktop tab in that
IP configuration option.
DEPSTAR-IT
32
IT344 Computer Network
18DIT056
•
Next step is the router configuration of router 0
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 10.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface Serial2/0
Router(config-if)#ip address 192.0.0.1 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
•
Next step is the router configuration of router 1
Router(config)#interface FastEthernet0/0
Router(config-if)#ip address 20.0.0.1 255.0.0.0
Router(config-if)#no shutdown
Router(config-if)#exit
Router(config)#interface Serial2/0
Router(config-if)#ip address 192.0.0.2 255.255.255.0
Router(config-if)#ip address 192.0.0.2 255.255.255.0
Router(config-if)#no shutdown
Router(config-if)#exit
•
•
•
•
After that, to configure NAT Configuration, We have to Click on Router0 and go to CLI tab.
And write, Router(config)#ip nat inside source static 10.0.0.5 50.0.0.5
And write, Router(config)#ip nat inside source static 10.0.0.4 50.0.0.4
After that, we have to assign private ip to inside network and public ip to outside so that, write,
Router(config)#int fa0/0
Router(config-if)#int nat inside
Router(config-if)#exit
For another serial port 2/0, write
Router(config)#int se2/0
Router(config-if)#int nat outside
Router(config-if)#exit
After that we have to apply Routing, so that write,
Router(config)#ip route 60.0.0.0 255.0.0.0 192.0.0.2
Router(config)#exit
•
•
DEPSTAR-IT
33
IT344 Computer Network
18DIT056
•
•
•
After that, to configure NAT Configuration, We have to Click on Router1 and go to CLI tab.
And write, Router(config)#ip nat inside source static 20.0.0.5 60.0.0.5
After that, we have to assign private ip to inside network and public ip to outside so that, write,
Router(config)#int fa0/0
Router(config-if)#int nat inside
Router(config-if)#exit
•
For another serial port 2/0, write
Router(config)#int se2/0
Router(config-if)#int nat outside
Router(config-if)#exit
After that we have to apply Routing, so that write,
Router(config)#ip route 50.0.0.0 255.0.0.0 192.0.0.1
Router(config)#exit
•
DEPSTAR-IT
34
IT344 Computer Network
Checking network:
18DIT056
We have ping to PC1 from PC0 using private ip as well as public ip and we got output as below
•
We have to check also in PC1,whether public IP is Responding or Private IP. To Check out this
first we need to go out our sever0 and there services->HTTP->edit (at below side) and do check
index.html or want to edit we can.
•
In PC1, Desktop->Web Browser->URL then have check like below so that we can get to know
that public ip is working and private is not.
DEPSTAR-IT
35
IT344 Computer Network
18DIT056
Conclusion: In this practical we learned about static and dynamic configuration of NAT(Network
Address Translation).
DEPSTAR-IT
36
IT344 Computer Network
18DIT056
Practical-7
Section-A
Aim: Design simple tcl script for Wired topology of 4 nodes in NS-2 and analyze various tcl
parameters like network nodes, links, queues and topology. Queue Size :- 5 ,Duplex Link, Queue Type
Droptail
Theory: NS2 stands for Network Simulator Version 2. It is an open-source event-driven simulator designed
specifically for research in computer communication networks.
•
•
•
•
•
•
•
•
It is a discrete event simulator for networking research.
It provides substantial support to simulate bunch of protocols like TCP, FTP, UDP, https and DSR.
It simulates wired and wireless network.
It is primarily Unix based.
Uses TCL as its scripting language.
Otcl: Object oriented support
Tclcl: C++ and otcl linkage
Discrete event scheduler
Topology:
Code:
set ns [new Simulator]
$ns color 1 red
set nf [open Prac1.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam Prac1.nam &
exit 0
}
set
set
set
set
n0
n1
n2
n3
[$ns
[$ns
[$ns
[$ns
node]
node]
node]
node]
#$ns [Type of link between node(duplex-link)] [node1 node2($n0 $n2)] [Bandwidth
delay queue type(10mb 10ms DropTail)]
DEPSTAR-IT
37
IT344 Computer Network
18DIT056
$ns duplex-link $n0 $n2 10mb 10ms DropTail
$ns duplex-link $n1 $n2 10mb 10ms DropTail
$ns duplex-link $n2 $n3 5mb 10ms DropTail
$ns duplex-link-op $n0 $n2 orient right-down
$ns duplex-link-op $n1 $n2 orient right-up
$ns duplex-link-op $n2 $n3 orient right
#tcp protocol
set tcp [new Agent/TCP]
$tcp set class_ 2
$ns attach-agent $n0 $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n3 $sink
$ns connect $tcp $sink
#to generate ftp traffic and also application
$tcp set fid_ 1
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ftp set type_ FTP
$ftp set packet_size_ 1000
$ftp set rate_ 1mb
$ns at 1.0 "$ftp start"
$ns at 2.0 "$ftp stop"
$ns at 3.0 "finish"
$ns run
Output:
1. At starting point
DEPSTAR-IT
2. When packet transfer begins
38
IT344 Computer Network
18DIT056
Section-B
Aim: Design simple tcl script for Wired topology of 6 nodes in NS-2 and analyze various tcl
parameters like network nodes, links, queues and topology.
Theory:
TRANSMISSION CONTROL PROTOCOL
(TCP)
TCP is a connection-oriented protocol. Connectionorientation means that the communicating devices
should establish a connection before transmitting data
and should close the connection after transmitting the
data.
TCP is reliable as it guarantees delivery of data to the
destination router.
TCP provides extensive error checking mechanisms. It
is because it provides flow control and
acknowledgment of data.
Sequencing of data is a feature of Transmission Control
Protocol (TCP). this means that packets arrive in-order
at the receiver.
TCP is comparatively slower than UDP.
Retransmission of lost packets is possible in TCP, but
not in UDP.
TCP has a (20-80) bytes variable length header.
TCP is heavy-weight.
TCP doesn’t supports Broadcasting.
TCP is used by HTTP, HTTPs, FTP, SMTP and Telnet.
USER DATAGRAM PROTOCOL (UDP)
UDP is the Datagram oriented protocol. This is
because there is no overhead for opening a
connection, maintaining a connection, and
terminating a connection. UDP is efficient for
broadcast and multicast type of network
transmission.
The delivery of data to the destination cannot be
guaranteed in UDP.
UDP has only the basic error checking mechanism
using checksums.
There is no sequencing of data in UDP. If ordering is
required, it has to be managed by the application
layer.
UDP is faster, simpler and more efficient than TCP.
There is no retransmission of lost packets in User
Datagram Protocol (UDP).
UDP has a 8 bytes fixed length header.
UDP is lightweight.
UDP supports Broadcasting.
UDP is used by DNS, DHCP, TFTP, SNMP, RIP, and
VoIP.
Topology:
DEPSTAR-IT
39
IT344 Computer Network
18DIT056
Code:
set
#to
$ns
$ns
ns [new Simulator]
color the transmission from diffrent node using different protocol
color 1 red
color 2 green
set nf [open prac7.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf nt
$ns flush-trace
close $nf
exec nam prac7.nam &
exit 0
}
#node varibles
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
#$ns [Type of link between node(duplex-link)] [node1 node2($n0 $n2)] [Bandwidth
delay queue type(10mb 10ms DropTail)]
$ns duplex-link $n0 $n2 10mb 10ms DropTail
$ns duplex-link $n1 $n2 10mb 10ms DropTail
$ns duplex-link $n2 $n3 5mb 5ms DropTail
$ns duplex-link $n3 $n4 10mb 10ms DropTail
$ns duplex-link $n3 $n5 10mb 10ms DropTail
#to check dropping of packets
$ns duplex-link $n2 $n3 5mb 15ms DropTail
#limiting the queue size between different nodes for storing limited number of
packects
$ns queue-limit $n2 $n3 5
$ns
$ns
$ns
$ns
$ns
duplex-link-op
duplex-link-op
duplex-link-op
duplex-link-op
duplex-link-op
DEPSTAR-IT
$n0
$n1
$n2
$n3
$n3
$n2
$n2
$n3
$n4
$n5
orient
orient
orient
orient
orient
right-down
right-up
right
right-up
right-down
40
IT344 Computer Network
18DIT056
#tcp protocol
#using sink as tcp provide synchronization between sender and receiver and many
other services
set tcp [new Agent/TCP]
$tcp set class_ 2
$ns attach-agent $n0 $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n4 $sink
$ns connect $tcp $sink
#to generate ftp traffic and also application
#providing flow id to ecah connection using fid
$tcp set fid_ 1
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ftp set type_ FTP
$ftp set packet_size_ 1000
$ftp set rate_ 1mb
#upd protocol
#using null as udp does not provide any kind of services
set udp [new Agent/UDP]
$ns attach-agent $n1 $udp
set null [new Agent/Null]
$ns attach-agent $n5 $null
$ns connect $udp $null
#cbr pure traffic
#providing flow id to ecah connection using fid
$udp set fid_ 2
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set type_ CBR
$cbr set packet_size_ 1000
$cbr set rate_ 1mb
$ns
$ns
$ns
$ns
$ns
at
at
at
at
at
1.0
2.0
1.5
3.0
4.0
"$ftp start"
"$ftp stop"
"$cbr start"
"$cbr stop"
"finish"
$ns run
DEPSTAR-IT
41
IT344 Computer Network
18DIT056
Output:
DEPSTAR-IT
42
IT344 Computer Network
18DIT056
Section C
Aim: To demonstrate various queuing mechanisms and make comparative analysis of various queuing
techniques. (using trace file) (Droptail, RED,SFQ,FQ,FIFO)
Theory:
Drop Tail - It is a simple queue mechanism that is used by the routers that when packets should to be drop. In this
mechanism each packet is treated identically and when queue filled to its maximum capacity the newly incoming
packets are dropped until queue have sufficient space to accept incoming traffic.
Fair Queuing - It is a queuing mechanism that is used to allow multiple packets flow to comparatively share the
link capacity. Routers have multiple queues for each output line for every user. When a line as available as idle
routers scans the queues through round robin and takes first packet to next queue. FQ also ensure about the
maximum throughput of the network. For more efficiency weighted queue mechanism is also used.
RED - Random Early Detection (RED) is a congestion avoidance queuing mechanism (as opposed to a congestion
administration mechanism) that is potentially useful, particularly in high-speed transit networks. Sally Floyd and
Van Jacobson projected it in various papers in the early 1990s.It is active queue management mechanism. It operates
on the average queue size and drop packets on the basis of statistics information. If the buffer is empty all incoming
packets are acknowledged. As the queue size increase the probability for discarding a packet also increase. When
buffer is full probability becomes equal to 1 and all incoming packets are dropped.
Stochastic Fair Queuing - This queuing mechanism is based on fair queuing algorithm and proposed by John
Nagle in 1987. Because it is impractical to have one queue for each conversation SFQ uses a hashing algorithm
which divides the traffic over a limited number of queues. It is not so efficient than other queues mechanisms but it
also requires less calculation while being almost perfectly fair. It is called "Stochastic" due to the reason that it does
not actually assign a queue for every session; it has an algorithm which divides traffic over a restricted number of
queues using a hashing algorithm. SFQ assigns a pretty large number of FIFO queues
Deficit Round Robin - It is a modified weighted round robin scheduling mechanism. It can handle packets of
different size without having knowledge of their mean size. Deficit Round Robin keeps track of credits for each
flow. It derives ideas from Fair Queuing and Stochastic FQ. It uses hashing to determine the queue to which a flow
has to be assigned and collisions automatically reduce the bandwidth guaranteed to the flow. Each queue is
assigned a quantum and can send a packet of size that can fit in the available quantum. If not, the idle quantum gets
added to this meticulous queue’s deficit and the packet can be sent in the next round. The quantum size is a very
vital parameter in the DRR scheme, determining the upper bound on the latency as well as the throughput.
Explain Scenario: For FQ, SFQ queue we have to find the delay and queue limit foe the packet to start
droping. the queue limits model, which is used by the traffic control to limit the NetDevices queueing delay. It
operates on the transmission path of the network node. The queueing delay is the time a job waits in a queue until
it can be executed. It is a key component of network delay
Table
Queue Type
RED
DropTail
FQ
SFQ
DEPSTAR-IT
Delay
5
3
2
2
Queue limit
5
4
10
10
BANDWIDTH
5
5
5
5
43
IT344 Computer Network
18DIT056
Code:
set
#to
$ns
$ns
ns [new Simulator]
color the transmission from diffrent node using different protocol
color 1 red
color 2 green
set nf [open prac7.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf nt
$ns flush-trace
close $nf
exec nam prac7.nam &
exit 0
}
#node varibles
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
#$ns [Type of link between node(duplex-link)] [node1 node2($n0 $n2)] [Bandwidth
delay queue type(10mb 10ms DropTail)]
$ns duplex-link $n0 $n2 10mb 10ms DropTail
$ns duplex-link $n1 $n2 10mb 10ms DropTail
#changing node n2 and n3 queue type
# For RED type queue
$ns duplex-link $n2 $n3 5mb
# For Droptail type queue
$ns duplex-link $n2 $n3 5mb
# For FQ type queue
$ns duplex-link $n2 $n3 5mb
# For SFQ type queue
$ns duplex-link $n2 $n3 5mb
5ms RED
3ms DropTail
2ms FQ
2ms SFQ
$ns duplex-link $n3 $n4 10mb 10ms DropTail
$ns duplex-link $n3 $n5 10mb 10ms DropTail
#to check dropping of packets
#$ns duplex-link $n2 $n3 5mb 15ms DropTail
DEPSTAR-IT
44
IT344 Computer Network
18DIT056
#limiting the queue size between different nodes for storing limited number of
packects
# for RED - 5, DropTail – 4, FQ – 10, SFQ - 10
$ns queue-limit $n2 $n3 5
$ns
$ns
$ns
$ns
$ns
duplex-link-op
duplex-link-op
duplex-link-op
duplex-link-op
duplex-link-op
$n0
$n1
$n2
$n3
$n3
$n2
$n2
$n3
$n4
$n5
orient
orient
orient
orient
orient
right-down
right-up
right
right-up
right-down
#tcp protocol
#using sink as tcp provide synchronization between sender and receiver and many
other services
set tcp [new Agent/TCP]
$tcp set class_ 2
$ns attach-agent $n0 $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n4 $sink
$ns connect $tcp $sink
#to generate ftp traffic and also application
#providing flow id to ecah connection using fid
$tcp set fid_ 1
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ftp set type_ FTP
$ftp set packet_size_ 1000
$ftp set rate_ 1mb
#upd protocol
#using null as udp does not provide any kind of services
set udp [new Agent/UDP]
$ns attach-agent $n1 $udp
set null [new Agent/Null]
$ns attach-agent $n5 $null
$ns connect $udp $null
#cbr pure traffic
#providing flow id to ecah connection using fid
$udp set fid_ 2
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
$cbr set type_ CBR
$cbr set packet_size_ 1000
$cbr set rate_ 1mb
$ns at 1.0 "$ftp start"
$ns at 2.0 "$ftp stop"
DEPSTAR-IT
45
IT344 Computer Network
$ns
$ns
$ns
$ns
18DIT056
at 1.5 "$cbr start"
at 3.0 "$cbr stop"
at 4.0 "finish"
run
Output –
RED
DropTail
DEPSTAR-IT
46
IT344 Computer Network
18DIT056
FQ, SFQ
For all four type of queue
DEPSTAR-IT
47
IT344 Computer Network
18DIT056
Section 4
Aim: To demonstrate the use of AWK script with NS2 trace file of scenario A. Find Out Throughput,
Packet delivery ratio , Number Drop Packets for all Queues.
Theory:
The file written by an application (or by the Coverage Server) to store coverage information or overall
network information and In NS2, it is called as Trace File.
In order to generate a trace file. we have to create a trace file in Otcl script.
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.
Code:
set
#to
$ns
$ns
ns [new Simulator]
color the transmission from diffrent node using different protocol
color 1 red
color 2 green
set nf [open prac7.nam w]
$ns namtrace-all $nf
#creating trace file
set nt [open prac7.tr w]
$ns trace-all $nt
proc finish {} {
global ns nf nt
$ns flush-trace
close $nf
close $nt
exec nam prac7.nam &
exec awk -f prac7-tp.awk prac7.tr &
exit 0
}
#node varibles
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
set n3 [$ns node]
set n4 [$ns node]
set n5 [$ns node]
#$ns [Type of link between node(duplex-link)] [node1 node2($n0 $n2)] [Bandwidth
delay queue type(10mb 10ms DropTail)]
$ns duplex-link $n0 $n2 10mb 10ms DropTail
$ns duplex-link $n1 $n2 10mb 10ms DropTail
DEPSTAR-IT
48
IT344 Computer Network
18DIT056
$ns duplex-link $n2 $n3 5mb 5ms DropTail
$ns duplex-link $n3 $n4 10mb 10ms DropTail
$ns duplex-link $n3 $n5 10mb 10ms DropTail
#to check dropping of packets
$ns duplex-link $n2 $n3 5mb 15ms DropTail
#limiting the queue size between different nodes for storing limited number of
packects
$ns queue-limit $n2 $n3 5
$ns
$ns
$ns
$ns
$ns
duplex-link-op
duplex-link-op
duplex-link-op
duplex-link-op
duplex-link-op
$n0
$n1
$n2
$n3
$n3
$n2
$n2
$n3
$n4
$n5
orient
orient
orient
orient
orient
right-down
right-up
right
right-up
right-down
#tcp protocol
#using sink as tcp provide synchronization between sender and receiver and many
other services
set tcp [new Agent/TCP]
$tcp set class_ 2
$ns attach-agent $n0 $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n4 $sink
$ns connect $tcp $sink
#to generate ftp traffic and also application
#providing flow id to ecah connection using fid
$tcp set fid_ 1
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ftp set type_ FTP
$ftp set packet_size_ 1000
$ftp set rate_ 1mb
#upd protocol
#using null as udp does not provide any kind of services
set udp [new Agent/UDP]
$ns attach-agent $n1 $udp
set null [new Agent/Null]
$ns attach-agent $n5 $null
$ns connect $udp $null
#cbr pure traffic
#providing flow id to ecah connection using fid
$udp set fid_ 2
set cbr [new Application/Traffic/CBR]
$cbr attach-agent $udp
DEPSTAR-IT
49
IT344 Computer Network
18DIT056
$cbr set type_ CBR
$cbr set packet_size_ 1000
$cbr set rate_ 1mb
$ns
$ns
$ns
$ns
$ns
$ns
at 1.0
at 2.0
at 1.5
at 3.0
at 4.0
run
"$ftp start"
"$ftp stop"
"$cbr start"
"$cbr stop"
"finish"
#Screenchot of making trace file
AWK script :
BEGIN{
#for tcp and udp connection differently
#for tcp
stime=0
ftime=0
flag=0
fsize=0
throughput=0
latency=0
#for udp
stime1=0
ftime1=0
flag1=0
fsize1=0
throughput1=0
latency1=0
}
#for tcp looping
{
DEPSTAR-IT
50
IT344 Computer Network
18DIT056
if($1=="r" && $4==4){
fsize+=$6
if(flag==0){
stime=$2
flag=1
}
ftime=$2
}
}
#for udp looping
{
if($1=="r" && $4==5){
fsize1+=$6
if(flag1==0){
stime1=$2
flag1=1
}
ftime1=$2
}
}
END{
latency=ftime-stime
#to convert into bits we multiply it with 8
#for tcp conn
throughput=(fsize*8)/latency
printf("\nfor tcp conn")
printf("\nlatancy: %f",latency)
printf("\nthroughput: %f",throughput)
#for udp conn
latency1=ftime1-stime1
throughput1=(fsize1*8)/latency1
printf("\nfor udp conn")
printf("\nlatancy: %f",latency1)
printf("\nthroughput: %f",throughput1)
}
•
How to link awk script with tr file in tcl script
#creating trace file
set nt [open prac7.tr w]
$ns trace-all $nt
proc finish {} {
global ns nf nt
$ns flush-trace
close $nf
close $nt
exec nam prac7.nam &
DEPSTAR-IT
51
IT344 Computer Network
18DIT056
exec awk -f prac7-tp.awk prac7.tr &
exit 0
}
Output:
Conclusion:
In this practical we learned about the types of queue , how to design simple tcl script for Wired topology, we also
learned about tr file and awk script to know latency and throughput.
DEPSTAR-IT
52
IT344 Computer Network
18DIT056
Practical- 8
Aim: Create ring and mesh topology in NS2 and learn about the dynamic routing while one link goes
down.
Theory:
Ring Topology
In ring topology each device is connected with the two devices on either side of it. There are two
dedicated point to point links a device has with the devices on the either side of it. This structure forms a
ring thus it is known as ring topology. If a device wants to send data to another device then it sends the
data in one direction, each device in ring topology has a repeater, if the received data is intended for
other device then repeater forwards this data until the intended device receives it.
Mesh topology
In mesh topology each device is connected to every other device on the network through a dedicated
point-to-point link. When we say dedicated it means that the link only carries data for the two connected
devices only. Lets say we have n devices in the network then each device must be connected with (n-1)
devices of the network. Number of links in a mesh topology of n devices would be n(n-1)/2.
Dynamic Routing – DV & LS
Dynamic routing is a networking technique that provides optimal data routing. Unlike static routing,
dynamic routing enables routers to select paths according to real-time logical network layout changes.
Dynamic routing protocols allow routers to share information about the network with other routers to
allow them to select the best path to reach a destination.
Distance Vector Routing
Based on the least number of hops
Full routing table
It updates On broadcast
Low utilization of CPU and memory
High simplicity
DEPSTAR-IT
Link State Routing
Based on the cost
Link state updates
It updates On multicast
Intensive utilization of CPU and memory
Requires a trained network administrator
53
IT344 Computer Network
18DIT056
Topology:
1. Ring
2. Mesh
DEPSTAR-IT
54
IT344 Computer Network
18DIT056
Topology:
NAM (Before sending any packet)
1. Ring
2. Mesh
DEPSTAR-IT
55
IT344 Computer Network
18DIT056
Code:
Ring Topology
set ns [new Simulator]
$ns rtproto DV
set nf [open ring.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam ring.nam &
exit 0
}
set
set
set
set
n0
n1
n2
n3
[$ns
[$ns
[$ns
[$ns
node]
node]
node]
node]
$ns
$ns
$ns
$ns
duplex-link
duplex-link
duplex-link
duplex-link
$ns
$ns
$ns
$ns
duplex-link-op
duplex-link-op
duplex-link-op
duplex-link-op
$n0
$n1
$n2
$n3
$n1
$n2
$n3
$n0
$n0
$n1
$n2
$n3
10Mb
10Mb
10Mb
10Mb
$n1
$n2
$n3
$n0
10ms
10ms
10ms
10ms
orient
orient
orient
orient
DropTail
DropTail
DropTail
DropTail
right
down
left
up
set tcp [new Agent/TCP]
$tcp set class_ 2
$ns attach-agent $n0 $tcp
set sink [new Agent/TCPSink]
$ns attach-agent $n2 $sink
$ns connect $tcp $sink
set ftp [new Application/FTP]
$ftp attach-agent $tcp
$ftp set type_ FTP
$ftp set packet_size_ 1000
$ftp set rate_ 1mb
DEPSTAR-IT
56
IT344 Computer Network
18DIT056
$ns at 1.0 "$ftp start"
$ns rtmodel-at 2.0 down $n1 $n2
$ns rtmodel-at 3.0 up $n2 $n2
$ns at 4.0 "$ftp stop"
$ns at 5.0 "finish"
$ns run
Mesh Topology
#Changed Statements
$ns duplex-link $n0 $n2 10Mb 20ms DropTail
$ns duplex-link $n1 $n3 10Mb 20ms DropTail
$ns duplex-link-op $n0 $n2 orient right-down
$ns duplex-link-op $n1 $n3 orient left-down
$ns rtmodel-at 2.0 down $n0 $n2
$ns rtmodel-at 3.0 up $n0 $n2
DEPSTAR-IT
57
IT344 Computer Network
18DIT056
Output:
Ring Topology
1. When Link Goes down
2. When Link Goes up
DEPSTAR-IT
58
IT344 Computer Network
18DIT056
Mesh Topology
1. When Link Goes down
2. When Link Goes up
Conclusion: In this practical, we have implemented ring and mesh topology in NS2 and also dynamic
routing while one link goes down.
DEPSTAR-IT
59
IT344 Computer Network
18DIT056
Practical-10
Aim: To work with SDN technology and SD WAN
Theory:
What is SD WAN and how it works?
• A Software-defined Wide Area Network (SD-WAN) is a virtual WAN architecture that allows
enterprises to leverage any combination of transport services – including MPLS, LTE and
broadband internet services to securely connect users to applications.
•
There are three main components to this virtualized network: The SD-WAN edge, the controller,
and the orchestrator.
•
The SD-WAN edge is where the network endpoints reside. This can be a branch office, a remote
data center, or cloud platform.
•
An SD-WAN Orchestrator is the virtualized manager for network, overseeing traffic and applying
policy and protocol set by operators.
•
The SD-WAN Controller centralizes management, and enables operators to see the network
through a single pane of glass, and set policy for the orchestrator to execute.
•
These components make up the basic structure of an SD-WAN. In addition, there are three main
types of architecture: on-premises, cloud-enabled, and cloud-enabled with a backbone.
•
An On-premises SD-WAN is where the SD-WAN hardware resides on-site. Network operators
can directly access and manage the network and the hardware it resides on, and it does not use the
cloud for its connections. This makes it ideal for sensitive information that cannot be sent over the
internet.
•
Cloud-enabled SD-WANs connect to a virtual cloud gateway over the internet, which makes the
network more accessible, and provides better integration and performance with cloudnative applications.
•
Cloud-Enabled with Backbone SD-WANs give organizations an extra backup by connecting the
network with a nearby point of presence (PoP), such as within a data centre. It allows traffic to
switch from the public internet to a private connection. Moving to a private connection leads to a
more secure SD-WAN and adds consistency in case the connection is overwhelmed or fails.
DEPSTAR-IT
60
IT344 Computer Network
18DIT056
CHARACTERISTICS:
•
•
•
•
Better Prioritization
Flexible Bandwidth Allocation
Dynamic Connection Establishment
Minimal Packet Loss
ADVANTAGES:
•
•
•
•
•
Improves Performance
Boosts Security
Lowers complexity
Enables cloud storage
Reduces costs
DISADVANTAGES:
•
•
•
•
SD-WANs have not been fully adopted yet.
There is no on-site security functionality.
IT staffs will have to be heavily relied on in order to deploy and maintain this technical solution.
SD-WAN networks are immune to slow performance.
Conclusion: By doing this practical we learned about what is SD WAN technology, how it works and
its advantages and disadvantages.
DEPSTAR-IT
61
Download