CN File
CN File
AIM:
Explain the various connecting devices.
THEORY:
Following are various connecting devices used in Computer Networks:
Repeater: A repeater operates at the physical layer. Its job is to regenerate the signal over the
same network before the signal becomes too weak or corrupted to extend the length to which the
signal can be transmitted over the same network. An important point to be noted about repeaters
is that they do not amplify the signal. When the signal becomes weak, they copy the signal bit by
bit and regenerate it at the original strength. It is a 2 port device.
Hub: A hub is a multiport repeater. A hub connects multiple wires coming from different
branches, for example, the connector in star topology which connects different stations. Hubs
cannot filter data, so data packets are sent to all connected devices. In other words, the collision
domain of all hosts connected through Hub remains one. Also, they do not have the intelligence
to find out the best path for data packets which leads to inefficiencies and wastage.
Types of Hub:
1. Active Hub:- These are the hubs that have their power supply and can clean, boost, and
relay the signal along with the network. It serves both as a repeater as well as a wiring
center. These are used to extend the maximum distance between nodes.
2. Passive Hub:- These are the hubs that collect wiring from nodes and power supply from
the active hub. These hubs relay signals onto the network without cleaning and boosting
them and can’t be used to extend the distance between nodes.
3. Intelligent Hub:- It works like active hubs and includes remote management capabilities.
They also provide flexible data rates to network devices. It also enables an administrator to
monitor the traffic passing through the hub and to configure each port in the hub.
Bridge: A bridge operates at the data link layer. A bridge is a repeater, with add on the
functionality of filtering content by reading the MAC addresses of source and destination. It is
also used for interconnecting two LANs working on the same protocol. It has a single input and
single output port, thus making it a 2 port device.
Types of Bridges:
1. Transparent Bridges: - These are the bridge in which the stations are completely
unaware of the bridge’s existence i.e. whether or not a bridge is added or deleted from
then network, reconfiguration of the stations is unnecessary. These bridges make use of
two processes i.e. bridge forwarding and bridge learning.
Switch: A switch is a multiport bridge with a buffer and a design that can boost its efficiency (a
large number of ports implies less traffic) and performance. A switch is a data link layer device.
The switch can perform error checking before forwarding data, which makes it very efficient as
it does not forward packets that have errors and forward good packets selectively to correct ports
only. In other words, the switch divides the collision domain of hosts, but the broadcast domain
remains the same.
Routers: A router is a device like a switch that routes data packets based on their IP addresses.
The router is mainly a Network Layer device. Routers normally connect LANs and WANs and
have a dynamically updating routing table based on which they make decisions on routing the
data packets. The router divides broadcast domains of hosts connected through it. Gateway: A
gateway, as the name suggests, is a passage to connect two networks that may work upon
different networking models. They work as the messenger agents that take data from one system,
interpret it, and transfer it to another system. Gateways are also called protocol converters and
can operate at any network layer.
Gateway: A gateway, as the name suggests, is a passage to connect two networks that may work
upon different networking models. They work as the messenger agents that take data from one
system, interpret it, and transfer it to another system. Gateways are also called protocol
converters and can operate at any network layer.
Brouter: It is also known as the bridging router a device that combines features of both bridge
and router. It can work either at the data link layer or the network layer. Working as a router, it
is capable of routing packets across networks, and working as a bridge, it is capable of filtering
local area network traffic.
Modem: Modem is a device that enables a computer to send or receive data over telephone or
cable lines. The data stored on the computer is digital whereas a telephone line or cable wire can
transmit only analog data.
The main function of the modem is to convert digital signals into analog and vice versa. The
modem is a combination of two devices − a modulator and a demodulator. The modulator
converts digital data into analog data when the data is sent by the computer. The demodulator
converts analog data signals into digital data when it is being received by the computer.
EXPERIMENT – 11
AIM:
Explain various Transmission Media.
THEORY:
Transmission media is a communication channel that carries the information from the sender to
the receiver. Data is transmitted through electromagnetic signals. It is a physical path between
transmitter and receiver in data communication. In the OSI(Open System Interconnection)
phase, transmission media supports Layer 1. Therefore, it is considered to be a Layer 1
component. The electrical signals can be sent through the copper wire, fiber optics, atmosphere,
water, and vacuum.
2. Distortion: Distortion occurs when there is a change in the shape of the signal. This
type of distortion is examined from different signals having different frequencies.
3. Noise: When data is traveled over a transmission medium, some unwanted signal is
added to it which creates the noise.
THEORY:
In order to connect computers in the Local area network we have to set up each system in the
network. In this example I will connect two computer systems.
PROCEDURE:
On the host computer:
On the host computer, follow these steps to share the Internet connection:
1. Log on to the host computer as Administrator or as Owner.
2. Click on Start, and then click on the Control Panel.
3. Click on Network and Internet Connections.
4. Click on Network Connections.
5. Right-click on the connection that you use to connect to the Internet.
6. Click on Properties.
7. Click the Advanced tab.
8. Under Internet Connection Sharing, select the Allow other network users to connect
through this computer's Internet connection check box.
9. If you are sharing a dial-up Internet connection, select the Establish a dial-up connection
whenever a computer on my network attempts to access the Internet check box if you
want to permit your computer to automatically connect to the Internet.
10. Click on OK. You receive the following message:
11. When Internet Connection Sharing is enabled, your LAN adapter will be set to use IP
address 192.168.0.1. Your computer may lose connectivity with other computers on
your network. If these other computers have static IP addresses, it is a good idea to set
them to obtain their IP addresses automatically. Are you sure you want to enable
Internet Connection Sharing?
12. Click Yes.
13. The connection to the Internet is shared to other computers on the local area network
(LAN).
14. The network adapter that is connected to the LAN is configured with a static IP address
of 192.168.0.1 and a subnet mask of 255.255.255.0.
On the client computer:
To connect to the Internet by using the shared connection, you must confirm the
LAN adapter IP configuration, and then configure the client computer. To confirm the LAN
adapter IP configuration, follow these steps:
1.Log on to the client computer as Administrator or as Owner.
2.Click on Start, and then click on the Control Panel.
3.Click on Network and Internet Connections.
4.Click Network Connections.
5.Right-click on Local Area Connection and then click on Properties.
6.Click the General tab, click Internet Protocol (TCP/IP) in the connection, use the
following items list, and then click Properties.
7.In the Internet Protocol (TCP/IP) Properties dialog box, click Obtain an IP address
automatically (if it is not already selected), and then click OK.
Note: You can also assign a unique static IP address in the range of 192.168.0.2 to
192.168.0.254. For example, you can assign the following static IP address, subnet mask,
and default gateway:
a. IP address 192.168.31.202
b. Subnet mask 255.255.255.0
c. Default gateway 192.168.31.1
8.In the Local Area Connection Properties dialog box, click OK.
9.Quit Control Panel.
Both Computers are successfully connected through the Local Area Network.
EXPERIMENT – 13
AIM:
Study of basic network command and Network configuration commands.
THEORY:
All commands related to Network configuration which includes how to switch to privilege mode
and normal mode and how to configure router interface and how to save this configuration to
flash memory or permanent memory.
This commands includes
Configuring the Router commands
General Commands to configure network
Privileged Mode commands of a router
Router Processes & Statistics
IP Commands
Other IP Commands e.g. show ip route etc.
Following are the commands used in Network Configuration:
1. Ping: ping sends an ICMP ECHO_REQUEST packet to the specified host. Ifthe host
responds, you get an ICMP packet back. We can “ping” an IP address tosee if a machine is
alive. If there is no response, you know something is wrong.
2. Tracert: ‘tracert’ is used for traceroute. ‘tracert’ is a command which can show you the
path a packet of information takes from your computer to one you specify. It will list all
the routers it passes through until it reaches its destination, or fails to and is discarded. In
addition to this, it will tell you how long each 'hop' from router to router takes.
3. nslookup: nslookup (stands for “Name Server Lookup”) is a useful command for getting
information from a DNS server. It is a network administration tool for querying the
Domain Name System (DNS) to obtain domain name or IP address mapping or any other
specific DNS record. It is also used to troubleshoot DNS related problems.
3.co?: To complete a command enter a few known characters followed by a question mark
(with no space):
4.show: Enter show command with ? ( Question mark ) to list all available commands.
5.configure terminal: Enters global configuration mode, when using the console port.
PROGRAM:
Ring Topology:
set ns [new Simulator]
$ns rtproto DV
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace close $nf
exec nam out.nam exit 0
}
#Creating Nodes
for {set i 0} {$i<7} {incr i} { set n($i) [$ns node]
}
#Creating Links
for {set i 0} {$i<7} {incr i} {
$ns duplex-link $n($i) $n([expr ($i+1)%7]) 512Kb 5ms DropTail
}
Star Topology:
#This program will create a Star Topolgy using for loop in tcl in order to use less statements
set ns [new Simulator]
$ns color 1 blue
$ns color 2 red
$ns rtproto DV
proc finish {} {
global ns nf
$ns flush-trace close $nf
exec nam out.nam exit 0
}
#creating Nodes
for {set i 0} {$i<7} {incr i} {
set n($i) [$ns node]
}
#Creating Links
for {set i 1} {$i<7} {incr i} {
$ns duplex-link $n(0) $n($i) 512Kb 10ms SFQ
}
#TCP_Config
set tcp0 [new Agent/TCP]
$tcp0 set class_ 1
$ns attach-agent $n(1) $tcp0
set sink0 [new Agent/TCPSink]
$ns attach-agent $n(4) $sink0
$ns connect $tcp0 $sink0
#UDP_Config
set udp0 [new Agent/UDP]
$udp0 set class_ 2
$ns attach-agent $n(2) $udp0
set null0 [new Agent/Null]
$ns attach-agent $n(5) $null0
$ns connect $udp0 $null0
#CBR Config
set cbr0 [new Application/Traffic/CBR]
$cbr0 set rate_ 256Kb
$cbr0 attach-agent $udp0
#FTP Config
set ftp0 [new Application/FTP]
$ftp0 attach-agent $tcp0
#Scheduling Events
$ns rtmodel-at 0.5 down $n(0) $n(5)
$ns rtmodel-at 0.9 up $n(0) $n(5)
$ns rtmodel-at 0.7 down $n(0) $n(4)
$ns rtmodel-at 1.2 up $n(0) $n(4)
$ns at 0.1 "$ftp0 start"
$ns at 1.5 "$ftp0 stop"
$ns at 0.2 "$cbr0 start"
$ns at 1.3 "$cbr0 stop"
$ns at 2.0 "finish"
$ns run
Hybrid Topology:
set ns [new Simulator]
set nf [open out.nam w]
$ns namtrace-all $nf
proc finish {} {
global ns nf
$ns flush-trace
close $nf
exec nam out.nam
exit 0
}
$ns rtproto DV
# setting events
$ns rtmodel-at 0.7 down $r(1) $r(2)
$ns rtmodel-at 1.0 up $r(1) $r(2)
$ns rtmodel-at 0.9 down $r(4) $r(3)
$ns rtmodel-at 1.3 up $r(4) $r(3)
OUTPUT:
1. Ring Topology:
2. Star Topology:
3. Hybrid Topology:
EXPERIMENT – 15
AIM:
Simulate three nodes point to point networks with a duplex link between them.
PROGRAM:
#creates a new simulator
set ns [new Simulator]
set nf [open prog1.nam w]
$ns namtrace-all $nf
set nd [open prog1.tr w]
$ns trace-all $nd
proc finish { } {
global ns nf nd
$ns flush-trace
close $nf
close $nd
exec nam prog1.nam &
exit 0
}
#creating nodes
set n0 [$ns node]
set n1 [$ns node]
set n2 [$ns node]
#linking nodes
$ns duplex-link $n0 $n1 1Mb 10ms DropTail
$ns duplex-link $n1 $n2 512Kb 10ms DropTail
OUTPUT: