Professional Documents
Culture Documents
Practical File of Computer Networks (CSEN3102) : Bachelor of Technology IN Computer Science and Information Technology
Practical File of Computer Networks (CSEN3102) : Bachelor of Technology IN Computer Science and Information Technology
Of
COMPUTER NETWORKS
(CSEN3102)
BACHELOR OF TECHNOLOGY
IN
COMPUTER SCIENCE AND INFORMATION TECHNOLOGY
Muskan Chauhan
(A40318075)
INDEX
Muskan Chauhan(A40318075)
LAN(Local Area Network) :-
It is a network which consists of less than 5000 interconnected devices across several buildings.
Characteristics of LAN
Advantages of LAN
Computer resources like hard-disks, DVD-ROM, and printers can share local area
networks. This significantly reduces the cost of hardware purchases.
You can use the same software over the network instead of purchasing the licensed
software for each client in the network.
Muskan Chauhan(A40318075)
Data of all network users can be stored on a single hard disk of the server computer.
You can easily transfer data and messages over networked computers.
It will be easy to manage data at only one place, which makes data more secure.
Local Area Network offers the facility to share a single internet connection among all the
LAN users.
Disadvantages of LAN
LAN will indeed save cost because of shared computer resources, but the initial cost of
installing Local Area Networks is quite high.
The LAN admin can check personal data files of every LAN user, so it does not offer
good privacy.
Unauthorized users can access critical data of an organization in case LAN admin is not
able to secure centralized data repository.
Local Area Network requires a constant LAN administration as there are issues related to
software setup and hardware failures
PAN is a computer network formed around a person. It generally consists of a computer, mobile,
or personal digital assistant. PAN can be used for establishing communication among these
personal devices for connecting to a digital network and the internet.
Characteristics of PAN
Disadvantages of PAN
It may establish a bad connection to other networks at the same radio bands.
Distance limits.
A Metropolitan Area Network or MAN is consisting of a computer network across an entire city,
college campus, or a small region. This type of network is large than a LAN, which is mostly
limited to a single building or site. Depending upon the type of configuration, this type of
network allows you to cover an area from several miles to tens of miles.
Characteristics of MAN
Advantages of MAN
Muskan Chauhan(A40318075)
It offers fast communication using high-speed carriers, like fiber optic cables.
It provides excellent support for an extensive size network and greater access to WANs.
The dual bus in MAN network provides support to transmit data in both directions
concurrently.
A MAN network mostly includes some areas of a city or an entire city.
Disadvantages of MAN
You need more cable to establish MAN connection from one place to another.
In MAN network it is tough to make the system secure from hackers
WAN (Wide Area Network) is another important computer network that which is spread across a
large geographical area. WAN network system could be a connection of a LAN which connects
with other LAN's using telephone lines and radio waves. It is mostly limited to an enterprise or
an organization.
Characteristics of LAN:
The software files will be shared among all the users; therefore, all can access to the
latest files.
Any organization can form its global integrated network using WAN.
Muskan Chauhan(A40318075)
Advantages of WAN
WAN helps you to cover a larger geographical area. Therefore business offices situated at
longer distances can easily communicate.
Contains devices like mobile phones, laptop, tablet, computers, gaming consoles, etc.
WLAN connections work using radio transmitters and receivers built into client devices.
Disadvantage of WAN
A star topology is a design of a network where a central node extends a cable (or wireless) to
each computer on the network. On a star network, computers are connected independently to the
center of the network.
A star topology allows straightforward management of the entire network from one place. Since
each node has its own connection, the loss of one node won't break the whole thing. If you need
to add a device to the network, it plugs right in, without additional extra effort.
The only problem is that there is a single point of failure in the star network. If there's only one
hub, the whole thing goes down. However, networking professionals will often have fail-over
servers--backups--that keep things running while they fix the main server.
Muskan Chauhan(A40318075)
Bus Topology
A bus topology is another type of design where a single cable connects all computers and the
information intended for the last node on the network must run through each connected
computer. If a cable is broken, all computers connected down the line cannot reach the network.
The benefit of a bus topology is a minimal use of cabling.
Ring Topology
A similar topology is called a ring. In this design, computers are connected via a single cable,
but the end nodes also are connected to each other. In this design, the signal circulates through
the network until it finds the intended recipient. If a network node is not configured properly, or
it is down temporarily for another reason, the signal will make a number of attempts to find its
destination.
A collapsed ring is a topology where the central node is a network device called a hub, a router,
or a switch. This device runs a ring topology internally and features plugins for cables. Next,
each computer has an independent cable, which plugs into the device. In offices that have the
collapsed ring, there will be a cabling closet, or a space containing a switch device that connects
the network. All computers in the office connect to the cabling closet and the switch. Even if a
network plug is near a desk, the plug is connected via a cable to the cabling closet.
With the increase of wireless technology, many nodes on the network will connect to a wireless
access point. This then connects to the main server(s)--the hubs--of a star network. Still, many
business are set up with Ethernet cables connecting computers to a type of ring network.
Muskan Chauhan(A40318075)
Mesh Topology
A mesh topology is a network setup where each computer and network device is interconnected
with one another. This topology setup allows for most transmissions to be distributed even if one
of the connections goes down. It is a topology commonly used for wireless networks. Below is a
visual example of a simple computer setup on a network using a mesh topology.
Muskan Chauhan(A40318075)
Muskan Chauhan(A40318075)
Program No.: 2
AIM: Study of connecting devices (Hubs, switches, routers, repeaters,
gateway, and bridge).
HUBS
Muskan Chauhan(A40318075)
SWITCHES
Figure 2: Switch
A switch is a device in a computer network that connects other devices together. Multiple
data cables are plugged into a switch to enable communication between different networked
devices. Switches manage the flow of data across a network by transmitting a received
network packet only to the one or more devices for which the packet is intended. Each
networked device connected to a switch can be identified by its network address, allowing the
switch to direct the flow of traffic maximizing the security and efficiency of the network.
A switch is more intelligent than an Ethernet hub, which simply retransmits packets out of
every port of the hub except the port on which the packet was received, unable to distinguish
different recipients, and achieving an overall lower network efficiency.
An Ethernet switch operates at the data link layer (layer 2) of the OSI model to create a
separate collision domain for each switch port. Each device connected to a switch port can
transfer data to any of the other ports at any time and the transmissions will not interfere.
Because broadcasts are still being forwarded to all connected devices by the switch, the
newly formed network segment continues to be a broadcast domain. Switches may also
operate at higher layers of the OSI model, including the network layer and above. A device
that also operates at these higher layers is known as a multilayer switch.
1. Switches are modern bridges by another name. It acts as multiport bridge to connect
devices or segments in a LAN. It operates at data link layer.
2. It is point to point device.
3. It is an intelligent device. It uses switching table to find the correct destination.
4. Also there are layer 2 (bridge) and layer 3 switches (kind of router). It is sophisticated
and expensive device.
5. Switches are of two types:
a) Store-and-forward switch: It stores the frame in the input buffer until the whole
packet has arrived.
b) Cut-through switch: It forwards the packet to the output buffer as soon as the
destination address is received.
Muskan Chauhan(A40318075)
ROUTER
Figure 3: Router
A router is a networking device that forwards data packets between computer networks.
Routers perform the traffic directing functions on the Internet. Data sent through the internet,
such as a web page or email, is in the form of data packets. A packet is typically forwarded
from one router to another router through the networks that constitute an internetwork (e.g.
the Internet) until it reaches its destination node.
A router is connected to two or more data lines from different networks. When a data packet
comes in on one of the lines, the router reads the network address information in the packet to
determine the ultimate destination. Then, using information in its routing table or routing
policy, it directs the packet to the next network on its journey.
The most familiar type of routers are home and small office routers that simply forward IP
packets between the home computers and the Internet. An example of a router would be the
owner's cable or DSL router, which connects to the Internet through an Internet service
provider (ISP). More sophisticated routers, such as enterprise routers, connect large business
or ISP networks up to the powerful core routers that forward data at high speed along the
optical fibre lines of the Internet backbone. Though routers are typically dedicated hardware
devices, software-based routers also exist.
1. Routers are devices that connect two or more networks. It operates at network layer.
2. They consist of a combination of hardware and software.
3. The hardware can be a network server, a separate computer or a special device. The
hardware includes the physical interfaces to the various networks in the internetwork.
4. These interfaces can be Token Ring, Ethernet, T1, Frame Relay, ATM or any other
technology.
5. The software in a router are the operating system and the routing protocol.
Management software can also be used.
6. Routers use logical and physical addressing to connect two or more logically separate
networks.
7. The network address allows routers to calculate the optimal path to a workstation or
computer.
8. The two methods of route discovery are Distance vector routing and Link state routing.
Muskan Chauhan(A40318075)
REPEATERS
Figure 4: Repeaters
A repeater is an electronic device that receives a signal and retransmits it. Repeaters are used
to extend transmissions so that the signal can cover longer distances or be received on the
other side of an obstruction.
Some types of repeaters broadcast an identical signal, but alter its method of transmission, for
example, on another frequency or baud rate.
There are several different types of repeaters; a telephone repeater is an amplifier in a
telephone line, an optical repeater is an optoelectronic circuit that amplifies the light beam in
an optical fibre cable; and a radio repeater is a radio receiver and transmitter that retransmits
a radio signal.
A broadcast relay station is a repeater used in broadcast radio and television.
1. The repeater operates in the physical layer.
2. These are analogy devices that work with signals on the cables to which they are
connected.
3. A signal appearing on one cable is regenerated and put out on another cable. Hence it
extends the physical length of LAN.
4. Repeaters do not understand frames, packets or headers. They understand the symbols
that encode bit as volts.
5. Classic Ethernet, for example, was designed to allow four repeaters that would boost
the signal to extend the maximum cable length from 500 meters to 2500 meters.
GATEWAYS
Figure 5: Gateways
Muskan Chauhan(A40318075)
A gateway is a node in a computer network, a key stopping point for data on its way to or
from other networks. Thanks to gateways, we are able to communicate and send data back
and forth. The Internet wouldn't be any use to us without gateways (as well as a lot of other
hardware and software).
In a workplace, the gateway is the computer that routes traffic from a workstation to the
outside network that is serving up the Web pages. For basic Internet connections at home, the
gateway is the Internet Service Provider that gives you access to the entire Internet.
A node is simply a physical place where the data stops for either transporting or
reading/using. (A computer or modem is a node; a computer cable isn't.)
A gateway is one of the many ways our data is moved over the Web for us. The gateway
gives us entry into different networks so we can send email, look at Web pages, buy things
online, and more. You can easily say that gateways deliver the freedom, information and
convenience we enjoy online.
Gateways, also called protocol converters, can operate at any network layer. The activities of
a gateway are more complex than that of the router or switch as it communicates using more
than one protocol.
Both the computers of internet users and the computers that serve pages to users are host
nodes. The nodes that connect the networks in between are gateways. These are gateway
nodes:
1. the computers that control traffic between company networks
2. the computers used by internet service providers (ISPs) to connect users to the
internet Gateway must be implied on larger networks to interconnect them.
BRIDGE
Muskan Chauhan(A40318075)
1. If the frame received by the bridge is meant for a segment that resides on the same
host network, it will pass the frame to that node and the receiving bridge will then
discard it.
2. If the bridge receives a frame whose node MAC address is of the connected network,
it will forward the frame toward it.
3. A bridge connects two or more LANs. It operates at data link layer.
4. Like a hub, a modern bridge has multiple ports, usually enough for 4 to 48 input lines
of a certain type. Unlike in a hub, each port is isolated to be its own collision domain.
5. When a frame arrives, the bridge extracts the destination address (for Ethernet, it is 48
bit) from the frame header and looks it up in a table to see where to send the frame.
6. The bridge only outputs the frame on the port where it is needed and can forward
multiple frames at the same time.
7. Filtering, forwarding and blocking of frames are functions of bridges.
8. Bridges offer much better performance than hubs and the isolation between bridge
ports also means that the input lines may run at different speeds, possibly even with
different network types. A common example is a bridge with ports that connect to 10-,
100-, and 1000-Mbps Ethernet.
9. Buffering within the bridge is needed to accept a frame on one port and transmit the
frame out on a different port.
10. Bridges were originally intended to be able to join different kinds of LANs, for
example, an Ethernet and a Token Ring LAN. However, this never worked well
because of differences between the LANs such as frame formats, maximum frame
lengths, security and Quality of service.
Muskan Chauhan(A40318075)
Program 3
AIM: Study of Netstat, IpConfig and Ping command.
‘Netstat’ command
‘netstat’ (network statistics) is a command line tool for monitoring network connections both
incoming and outgoing as well as viewing routing tables, interface statistics etc. netstat is
available on all Unix-like Operating Systems and also available on Windows OS as well. It is
very useful in terms of network troubleshooting and performance measurement. netstat is one
of the most basic network service debugging tools, telling you what ports are open and
whether any programs are listening on ports.
OPTION DESCREPTION
‘netstat -a’ Shows active TCP connections
Muskan Chauhan(A40318075)
‘netstat -r’ Shows IP routing table
‘netstat -n’ Displays active TCP connections without the names
‘netstat -s’ Displays statistics by protocol. By default, statistics are shown for the TCP,
UDP, ICMP, and IP protocols
Muskan Chauhan(A40318075)
1.‘netstat -a’ command
This switch displays active TCP connections, TCP connections with the listening
state, as well as UDP ports that are being listened to.
Muskan Chauhan(A40318075)
2. ‘netstat -n’ command
Use the -n switch to prevent netstat from attempting to determine host names for
foreign IP addresses. Depending on your current network connections, using this
switch could considerably reduce the time it takes for netstat to fully execute.
Muskan Chauhan(A40318075)
3. ‘netstat -s’ command
The -s option can be used with the netstat command to show detailed statistics by
protocol. You can limit the statistics shown to a particular protocol by using the –s
option and specifying that protocol, but be sure to use -s before -p protocol when
using the switches together.
IPCONFIG command
‘ipconfig’ is a console application designed to run from the Windows command prompt. This
utility allows you to get the IP address information of a Windows computer. It also allows
some control over active TCP/IP connections. Ipconfig replaced the older ‘winipcfg’ utility.
Muskan Chauhan(A40318075)
OPTION DESCREPTION
Muskan Chauhan(A40318075)
1. ‘ipconfig /all’ command
‘ipconfig /all’ displays all configuration information for each adapter bound to TCP/IP. This
activity will show you how to use ipconfig /all.
3. ‘ipconfig /displaydns’
‘ipconfig /displaydns’ displays the contents of the Domain Name System (DNS) resolver
cache. ipconfig /flushdns purges the DNS resolver cache.
Muskan Chauhan(A40318075)
Muskan Chauhan(A40318075)
‘PING’ command
The ping command is a Command Prompt command used to test the ability of the source
computer to reach a specified destination computer. The ping command is usually used as a
simple way to verify that a computer can communicate over the network with another
computer or network device.
Example:
‘ping pdm.ac.in’
Muskan Chauhan(A40318075)
Program 4
AIM: Study of ‘tracert’ (trace route) command.
Trace Command
The tracert (which is short for trace route) is a Windows network command-line utility used to help diagnose
network routing issues. If you are familiar with Linux, this tool is similar to traceroute. With tracert, you can
learn details about each router (hop) that make up your network connection pathway to a remote device. It
can help to determine why your connections may be poor and can help you identify where exactly the
problem is.
Example:
Muskan Chauhan(A40318075)
Program 5
AIM: Study of ‘nslookup’ command.
‘nslookup command’:
Nslookup (stands for “Name Server Lookup”) is a useful command for getting information from 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.
There are different scenarios in which the use of nslookup is appropriate. In this way, the command-line
program is an especially crucial tool when resolving DNS issues. First and foremost, a data query helps find
the cause of the problem at hand. For example, those who use Windows and experience an issue with the
active directory can use nslookup to quickly and easily check whether all involved servers are converted in
the domain name system as planned. Generally, this program shows its strengths when
various subdomains are involved – not only when it is simply a matter of checking them, but also when there
are connection problems.
Example:
Muskan Chauhan(A40318075)
Program 6
AIM: Sharing a folder via LAN.
File sharing
File sharing is the public or private sharing of computer data or space in a network with
various levels of access privilege. FTP can be used to access (read and possibly write to) files
shared among a set of users with a password to gain access to files shared from an FTP server
site.
Step 1: Open the PROPERTIES of the folder that you want to share.
Step 3: Head to PERMISSIONS tab and allow the users to have full control by ticking the
‘full control’ check box.
Step 4: Apply the settings and open ‘network and sharing centre’.
v
Step 7: On the desktop screen press ‘Windows + R’ to open the ‘RUN’ window, and enter
the IPv4 address to open the shared folders.
Step 8: On entering the IPv4 a new window appers where we can see the shared folder
‘Shalu’.
Muskan Chauhan(A40318075)
Program 7
AIM: Sharing Desktop via LAN.
Desktop sharing
Windows Desktop Sharing is used by software developers to create applications that use
multiple-party screen-sharing technology. Key scenarios include remote assistance, real-time
collaboration and conferencing, and video communication. With Remote Desktop Services, a
session is always created when a user connects remotely through Remote Desktop Protocol
(RDP). With Windows Desktop Sharing, a local desktop can be transmitted over an RDP
connection without creating an additional session.
Steps involved in Desktop sharing:
Step 1: Open the PROPERTIES of the desktop that you want to share.(in this case ‘aryan’ is
the folder name).
Step 2: Go to SHARING tab to open ADVANCED SHARING options and tick ‘share
this folder’.
Step 3: Head to PERMISSIONS tab and allow the users to have full control by ticking the
‘full control’ check box.
Step 4: Apply the settings and open ‘network and sharing centre’.
Step 7: On the desktop screen press ‘Windows + R’ to open the ‘RUN’ window, and enter
the IPv4 address to open the shared folders.
Step 8: On entering the IPv4 a new window appers where we can see the shared folder
‘Desktop’.
Muskan Chauhan(A40318075)
PROGRAM No. 8
AIM: Study about Iv4 and IPv6.
(i) Internet protocol version 4 (IPV4)
Internet protocol version 4 (IPV4) was first published in 1981, it is the fourth version of
internet protocol, and it is the first version of the protocol to be widely deployed in
TCP/IP.
The main function of protocol is to identify host on the network by their logical address in
other to established communication between them on the network. The IPV4 is a
connectionless protocol for use in packet switched network, meaning that it does not reserve
resources (bandwidth for link and schedule process time for the package) to be used during
communication. It does not request connect when sending data and it know the destination
address through routing table. The resources are allocated whenever the need arise IPV4 are
basically categories into five classes, Classes A, B and C varied in bit length for
addressing a network host while Class D is reserve for multicast and the last class which is E
is for purposely for experimental and study purpose. This can be seen in the table below.
Muskan Chauhan(A40318075)
IPV4 PACKET LOSE AND RECOVERY
Any packets sent on the network go along header which guides the packet to reach
the destination. When a packet lose it destination as a result of routing error, the IPv4 use
Time- to-Live (TTL) field which contain a detail on how long a packet can live and navigate
on a network. It prevent packet from infinite looping, which allow a packet to navigate on
network 255 times. After the packet elapse the time, the packet is discard and send
internet control message protocol (ICMP) message to the original host to resend the package.
LIMITATION OF IPv4
The limitation of IPv4 arouse the idea of IPv6, some of the IPv4 limitation are
inadequate address, insufficient security and mobile device compatibility. Since it has been
notice that this limitation will affect the future internet, this was the driving factor for the
introduction of some techniques that will reduce the rapid exhaustion of the address.
These two techniques are Classless Internet Domain Router (CIDR) and Network Address
Transition (NAT. 3. IPv4 NETWORK ADDRESS TRANSLATION (NAT) Network address
translation (NAT): This is another technique help to minimize the depletion of IP address
space by combining several IP address into a single IP address, the single IP address serve as
an agent between the multiple hosts. NAT align private address to public address to
communicate on the internet. When clients with private address want to share a file with
public address on the network, normally the packets contain both the physical and logical
address of the destination. NAT take the IP address and TCP which is from private network
and modify it to appear like public IP address, so that the communication will not be intercept
by the internet security. NAT can also perform public-to-public address translation, as well as
private-to-private address translation. Therefor the introduction of Classless internet Domain
Router (CIDR) and Network Translation Address (NAT) minimize the rapid exhaustion of
IPV4 address space, still IPv4 will not serve the purpose for the future internet, the solution is
IPv6 .
Muskan Chauhan(A40318075)
PROGRAM No. 9
AIM: C++ Program for encryption and decryption of strings
Source code:
#include <bits/stdc++.h>
using namespace std;
string encryption(string s)
{
int l = s.length();
int b = ceil(sqrt(l));
int a = floor(sqrt(l));
string encrypted;
if (b * a < l) {
if (min(b, a) == b) {
b = b + 1;
}
else {
a = a + 1;
}
}
char arr[a][b];
memset(arr, ' ', sizeof(arr));
int k = 0;
for (int j = 0; j < a; j++) {
for (int i = 0; i < b; i++) {
if (k < l){
arr[j][i] = s[k];
}
k++;
}
}
for (int j = 0; j < b; j++) {
for (int i = 0; i < a; i++) {
encrypted = encrypted +
arr[i][j];
}
}
return encrypted;
}
string decryption(string s){
int l = s.length();
int b = ceil(sqrt(l));
int a = floor(sqrt(l));
string decrypted;
char arr[a][b];
memset(arr, ' ', sizeof(arr));
int k = 0;
for (int j = 0; j < b; j++) {
for (int i = 0; i < a; i++) {
if (k < l){
arr[j][i] = s[k];
}
k++;
Muskan Chauhan(A40318075)
}
}
for (int j = 0; j < a; j++) {
for (int i = 0; i < b; i++) {
decrypted = decrypted +
arr[i][j];
}
}
return decrypted;
}
int main()
{
string s = "pdm university";
string encrypted;
string decrypted;
encrypted = encryption(s);
cout << encrypted << endl;
decrypted = decryption(encrypted);
cout << decrypted;
return 0;
}
OUTPUT:
Muskan Chauhan(A40318075)
PROGRAM NO. 10
AIM: Configure IP address in a system of a LAN (TCP/IP configuration)
Step 1: Select Start, then select Settings, Network & Internet
Muskan Chauhan(A40318075)
Step 2: For a Wi-Fi network, select Wi-Fi then Manage known networks. Choose the network you want to
change the settings for, then select Properties.
Muskan Chauhan(A40318075)
Step 3: Under Edit IP settings, select Automatic (DHCP) or Manual. When you select Automatic (DHCP), the
IP address settings and DNS server address setting are set automatically by your router or other access point
(recommended).
Muskan Chauhan(A40318075)
Step 4: (For manual) When you select Manual, you can manually set your IP address settings and DNS server
address.
Muskan Chauhan(A40318075)