Sie sind auf Seite 1von 43

COMPUTER NETWORK

LAB FILE

SUBMITTED TO

SUBMITTED TO

Dr. Harish Kumar

Dhirman Preet Singh


UE123024
CSE 1 GROUP 2

INDEX
Sr.no

Experiment

Date

Page no

To study about the computer networks, network


components and different topologies.
To study the commands ipconfig and Ping.
To study the commands tracert and netstat.
To build a straight cable using RJ45 connector.
To study DES-3526 switch configuration and commands.
To write a program to check parity and hamming distance
To write a program for cyclic redundancy check .

04Aug2014

2-6

11Aug2014
25Aug2014
1 Sep2014
15 sep2014

7-17
18-27

2
3
4
5
6
7

-1-

EXPERIMENT 1

4th AUGUST 14

AIM- Introduction to different types of networks and its components.


A network is a set of devices (often referred to as nodes) connected by communication links. A node can
be a computer, printer, or any other device capable of sending and/or receiving data generated by other
nodes on the network.

Network Criteria
A network is judged on the basis of:
Performance-It can be measured in many ways, including transit time and response time. Transit
time is the amount of time required for a message to travel from one device to another. Response
time is the elapsed time between an inquiry and a response. The performance of a network
depends on a number of factors, including the number of users, the type of transmission medium,
the capabilities of the connected hardware, and the efficiency of the software.
Reliability-In addition to accuracy of delivery, network reliability is measured by the frequency of
failure, the time it takes a link to recover from a failure, and the network's robustness in a
catastrophe.
Security-Network security issues include protecting data from unauthorized access, protecting data
from damage and development, and implementing policies and procedures for recovery from
breaches and data losses.

Categories of Networks

Personal Area Networks- They let devices communicate over the range of a person. A common example is
a wireless network that connects a computer with its peripherals. E.g. Bluetooth to connect these
components without wires. The idea is that if your devices have Bluetooth, then you need no cables. You just
put them down, turn them on, and they work together

Local Area Network-A local area network (LAN) is usually privately owned and links the devices in a
single office, building, or campus .Depending on the needs of an organization and the type of
technology used, a LAN can be as simple as two PCs and a printer in someone's home office; or it
can extend throughout a company and include audio and video peripherals. Currently, LAN size is
limited to a few kilometres. LANs are designed to allow resources to be shared between personal
computers or workstations. The resources to be shared can include hardware e.g. printers

Wide Area Network-It provides long-distance transmission of data, image, audio, and video
information over large geographic areas that may comprise a country, a continent, or even the whole
world. A WAN can be as complex as the backbones that connect the Internet or as simple as a dial-up
line that connects a home computer to the Internet.

Metropolitan Area Networks- It is a network with a size between a LAN and a WAN. It normally covers
the area inside a town or a city. It is designed for customers who need a high-speed connectivity,
normally to the Internet, and have endpoints spread over a city or part of city. E.g. telephone company
network

-2-

EXPERIMENT 1

4th AUGUST 14

Network Components:
Components may be active or passive.

Active components inject power or provide power gain to the circuit .They rely on a source of energy
(usually from the DC circuit, which we have chosen to ignore) .Active components include amplifying
components such as transistors, triode vacuum tubes (valves), and tunnel diodes.
Passive components can't introduce net energy into the circuit. They also can't rely on a source of power, except for
what is available from the (AC) circuit they are connected to. As a consequence they can't amplify (increase the
power of a signal), although they may increase a voltage or current (such as is done by a transformer or resonant
circuit).Passive components include two-terminal components such as resistors, capacitors, inductors, and
transformers.

Type of Connection
There are two possible types of connections:
Point-to-Point A point-to-point connection provides a dedicated link between two devices. The
entire capacity of the link is reserved for transmission between those two devices. Most point-topoint connections use an actual length of wire or cable to connect the two ends.
Multipoint A multipoint (also called multidrop) connection is one in which more than two specific
devices share a single link .In a multipoint environment, the capacity of the channel is shared, either
spatially or temporally. If several devices can use the link simultaneously, it is a spatially shared
connection. If users must take turns, it is a timeshared connection.
Network topologies
These are categorized into the following basic types:

Bus Topology
All the nodes (file server, workstations, and peripherals) on this are connected by one single cable.
A bus topology consists of a main run of cable with a terminator at each end. All nodes (file server,
workstations, and peripherals) are connected to the linear cable.
Popular on LANs because they are inexpensive and easy to install.
Advantages
It is Cheap, easy to handle and implement.
Require less cable
It is best suited for small networks.
Disadvantages
The cable length is limited. This limits the number of stations that can be connected.
This network topology can perform well only for a limited number of nodes.

-3-

EXPERIMENT 1

4th AUGUST 14

Ring Topology
In a ring network, every device has exactly two neighbours for communication purposes.
All messages travel through a ring in the same direction.
A failure in any cable or device breaks the loop and can take down the entire network.
To implement a ring network we use the Token Ring technology
A token, or small data packet, is continuously passed around the network. When a device needs to
transmit, it reserves the token for the next trip around, then attaches its data packet to it.
Advantage
Very orderly network where every device has access to the token and the opportunity to transmit.
Easier to Mange than a Bus Network
Good Communication over long distances
Handles high volume of traffic
Disadvantages
The failure of a single node of the network can cause the entire network to fail.
The movement or changes made to network nodes affects the performance of the entire network.

Star Topology
Each node (file server, workstations, and peripherals) is connected to a central device called a hub.
The hub takes a signal that comes from any node and passes it along to all the other nodes in the
network.
Data on a star network passes through the hub, switch, or concentrator before continuing to its
destination.
The hub, switch, or concentrator manages and controls all functions of the network.
The star topology reduces the chance of network failure by connecting all of the systems to a central
node.
Advantages
Easy to manage
Easy to locate problems (cable/workstations)
Easier to expand than a bus or ring topology.
Easy to install and wire.
Easy to detect faults and to remove parts.
Disadvantages
Requires more cable length than a linear topology.
-4-

EXPERIMENT 1

4th AUGUST 14

If the hub or concentrator fails, nodes attached are disabled.


More expensive because of the cost of the concentrators.

Tree Topology
A tree topology (hierarchical topology) can be viewed as a collection of star networks arranged in a
hierarchy.
This tree has individual peripheral nodes which are required to transmit to and receive from one other
only and are not required to act as repeaters or regenerators.
The tree topology arranges links and nodes into distinct hierarchies in order to allow greater control and
easier troubleshooting.
This is particularly helpful for colleges, universities and schools so that each of the connect to the big
network in some way.
Advantages
Point-to-point wiring for individual segments.
Supported by several hardware and software vendors.
All the computers have access to the larger and their immediate networks.
Disadvantages
Overall length of each segment is limited by the type of cabling used.
If the backbone line breaks, the entire segment goes down.
More difficult to configure and wire than other topologies.

-5-

EXPERIMENT 1

4th AUGUST 14

Mesh Topology
In this topology, each node is connected to every other node in the network.
Implementing the mesh topology is expensive and difficult.
In this type of network, each node may send message to destination through multiple paths.
While the data is travelling on the Mesh Network it is automatically configured to reach the destination
by taking the shortest route which means the least number of hops.
Advantage
No traffic problem as there are dedicated links.
It has multiple links, so if one route is blocked then other routes can be used for data communication.
Points to point links make fault identification easy.
Disadvantage
There is mesh of wiring which can be difficult to manage.
Installation is complex as each node is connected to every node.
Cabling cost is high.

Hybrid Topology
A combination of any two or more network topologies.
A hybrid topology always accrues when two different basic network topologies are connected.
It is a mixture of above mentioned topologies. Usually, a central computer is attached with sub controllers which in turn participate in a variety of topologies .
Advantages
It is extremely flexible.
It is very reliable.
Disadvantages
Expensive

-6-

EXPERIMENT 2

11th AUGUST 14

AIM-to know more about different type of network commands and different types of address
A network consists of several computers connected together. The network can be as simple as a few computers
connected in your home or office, or as complicated as a large university network or even the entire Internet.
MAC ADDRESS
It is a unique identifier assigned to network interfaces for communications on the physical network segment. MAC
addresses are most often assigned by the manufacturer of a network interface controller(NIC) and are stored in its
hardware, such as the card's read-only memory or some other firmware mechanism. The standard format for
printing MAC-48 addresses in human-friendly form is six groups of two hexadecimal digits, separated by hyphens (-)
or colons (:), in transmission order (e.g. 01-23-45-67-89-ab or 01:23:45:67:89:ab ). The first half of a MAC
address contains the ID number of the adapter manufacturer. These IDs are regulated by an Internet standards body
(see sidebar). The second half of a MAC address represents the serial number assigned to the adapter by the
manufacturer.
IP ADDRESS
Every machine on a network has a unique identifier. computers use the unique identifier to send data to specific
computers on a network and is known as ip address.
There are two standards for IP addresses:
IPv4 uses 32 binary bits to create a single unique address on the network. An IPv4 address is expressed by
four numbers separated by dots. Each number is the decimal (base-10) representation for an eight-digit
binary (base-2) number, also called an octet. For example: 216.27.61.137
IPv6 uses 128 binary bits to create a single unique address on the network. An IPv6 address is expressed by
eight
groups
of
hexadecimal
(base-16)
numbers
separated
by
colons,
as
in
2001:cdba:0000:0000:0000:0000:3257:9652. Groups of numbers that contain all zeros are often omitted to
save space, leaving a colon separator to mark the gap (as in 2001:cdba::3257:9652).
IP CONFIG
Ipconfig is a Console Command which can be issued to the Command Line Interpreter (or command prompt) to
display the network settings currently assigned to any or all network adapters in the machine. This command can be
utilised to verify a network connection as well as to verify your network settings.

Syntax
ipconfig [/all] [/renew [Adapter]] [/release [Adapter]] [/flushdns] [/displaydns] [/registerdns]
[/showclassid Adapter] [/setclassid Adapter [ClassID]]

-7-

EXPERIMENT 2

11th AUGUST 14

/all
>>Displays the full TCP/IP configuration for all adapters. Without this parameter, ipconfig displays
only the IP address, subnet mask, and default gateway values for each adapter. Adapters can represent
physical interfaces, such as installed network adapters, or logical interfaces, such as dial-up connections.

-8-

EXPERIMENT 2

11th AUGUST 14

/renew
>>Renews DHCP configuration for all adapters (if an adapter is not specified) or for a
specific adapter if the Adapter parameter is included. This parameter is available only on computers
-9-

EXPERIMENT 2

11th AUGUST 14

with adapters that are configured to obtain an IP address automatically. To specify an adapter name, type
the adapter name that appears when you use ipconfig without parameters.

/release >>Sends a DHCPRELEASE message to the DHCP server to release the current DHCP
configuration and discard the IP address configuration for either all adapters (if an adapter is not
specified) or for a specific adapter if the Adapter parameter is included. This parameter disables
TCP/IP for adapters configured to obtain an IP address automatically. To specify an adapter name,
type the adapter name that appears when you use ipconfig without parameters.

/flushdns >> Flushes and resets the contents of the DNS client resolver cache. During DNS
troubleshooting, you can use this procedure to discard negative cache entries from the cache, as
well as any other entries that have been added dynamically.

/displaydns >> Displays the contents of the DNS client resolver cache, which includes both entries
preloaded from the local Hosts file and any recently obtained resource records for name queries
resolved by the computer. The DNS Client service uses this information to resolve frequently queried
names quickly, before querying its configured DNS servers.

- 10 -

EXPERIMENT 2

11th AUGUST 14

- 11 -

EXPERIMENT 2

11th AUGUST 14

/registerdns >> Initiates manual dynamic registration for the DNS names and IP addresses that are
configured at a computer. You can use this parameter to troubleshoot a failed DNS name
registration or resolve a dynamic update problem between a client and the DNS server without
rebooting the client computer. The DNS settings in the advanced properties of the TCP/IP protocol
determine which names are registered in DNS.

- 12 -

11th AUGUST 14

EXPERIMENT 2

/showclassid >> Displays the DHCP class ID for a specified adapter. To see the DHCP class ID for all
adapters, use the asterisk (*) wildcard character in place of Adapter. This parameter is available
only on computers with adapters that are configured to obtain an IP address automatically.

/setclassid >> Configures the DHCP class ID for a specified adapter. To set the DHCP class ID for all
adapters, use the asterisk (*) wildcard character in place of Adapter. This parameter is available
only on computers with adapters that are configured to obtain an IP address automatically. If a
DHCP class ID is not specified, the current class ID is removed.

Ping :
Verifies IP-level connectivity to another TCP/IP computer by sending Internet Control Message Protocol
(ICMP) Echo Request messages. Ping is the primary TCP/IP command used to troubleshoot connectivity,
reachability ,and name resolution. Used without parameters, ping displays help.

Syntax:
ping [-t] [-a] [-n Count] [-l Size] [-f] [-i TTL] [-v TOS] [-r Count] [-s Count] [{-j HostList | -k HostList}] [w Timeout] [TargetName].
Parameters
-t : Specifies that ping continue sending Echo Request messages to the destination until interrupted. To
interrupt and display statistics, press CTRL-BREAK. To interrupt and quit ping, press CTRL-C.
-a : Resolve address to hostnames.
-n Count : Specifies the number of Echo Request messages sent. The default is 4.
-l Size : Specifies the length, in bytes, of the Data field in the Echo Request messages sent. The default is
32. The maximum size is 65,527.
-f : Set Don't Fragment flag in the IP header set to 1. The Echo Request message cannot be fragmented by
routers in the path to the destination.
-i TTL : Specifies the value of the TTL field in the IP header for Echo Request messages sent. The default is
the default TTL value for the host. For Windows XP hosts, this is typically 128. The maximum TTL is 255.
-v TOS : Specifies the value of the Type of Service (TOS) field in the IP header for Echo Request messages
sent. The default is 0. TOS is specified as a decimal value from 0 to 255.
This has been deprecated and has no effect.
-r Count : To record the path taken by the Echo Request message and corresponding Echo Reply message.
Each hop in the path uses an entry in the Record Route option.
-s Count : Specifies that the Internet Timestamp option in the IP header is used to record the time of arrival
for the Echo Request message and corresponding Echo Reply message for each hop. The Count must be a
minimum of 1 and a maximum of 4.
-j HostList : Specifies that the Echo Request messages use the Loose Source Route option in the IP header with the
set of intermediate destinations specified in HostList. With loose source routing, successive intermediate
destinations can be separated by one or multiple routers. The maximum number of
- 13 -

EXPERIMENT 2

11th AUGUST 14

addresses or names in the host list is 9. The host list is a series of IP addresses (in dotted decimal notation)
separated by spaces.
-k HostList : Specifies that the Echo Request messages use the Strict Source Route option in the IP header
with the set of intermediate destinations specified in HostList. With strict source routing, the next
intermediate destination must be directly reachable (it must be a neighbor on an interface of the router).
The maximum number of addresses or names in the host list is 9. The host list is a series of IP addresses (in
dotted decimal notation) separated by spaces.
-w Timeout : Specifies the amount of time, in milliseconds, to wait for the Echo Reply message that
corresponds to a given Echo Request message to be received. If the Echo Reply message is not received
within the time-out, the "Request timed out" error message is displayed. The default time-out is 4000 (4
seconds).
-R :Use routing header to test reverse route also (IPv6-only).
-S srcaddr :Source address to use.
-c :compartment Routing compartment identifier.
-p : Ping a Hyper-V Network Virtualization provider address.
-4 :Force using IPv4.
-6 : Force using IPv6.
TargetName : Specifies the destination, which is identified either by IP address or host name.
/? : Displays help at the command prompt.

- 14 -

EXPERIMENT 2

11th AUGUST 14

Using ping:

1.

2.

3.

4.

5.
- 15 -

25th AUGUST 14

EXPERIMENT 3
Aim: To study the commands tracert and netstat.

The tracert is a command that's used to show several details about the path that a packet
takes from the computer or device you're on to whatever destination you specify. The
various options on running tracert command is tracert/?

Syntax: tracert [-d] [-h maximum_hops] [-j host-list] [-w timeout]


[-R] [-S srcaddr] [-4] [-6] target_name
Options:
-d
-h maximum_hops
-j host-list
-w timeout
-R
-S srcaddr
-4
-6

Do not resolve IP addresses to hostnames, often resulting in


much faster results.
Maximum number of hops to search for target.default value :30
Loose source route along host-list (IPv4-only).
Wait timeout milliseconds for each reply.
Trace round-trip path (IPv6-only).
Source address to use (IPv6-only).
Force using IPv4.
Force using IPv6.

- 16 -

EXPERIMENT 3

25th AUGUST 14

Usage :
tracert www.google.com

tracert d h 20 www.google.com

- 17 -

EXPERIMENT 3

25th AUGUST 14

Netstat : The netstat command is a Command Prompt command used to display detailed information about how
the computer is communicating with other computers or network devices. This, command can show details about
individual network connections, overall and protocol-specific networking statistics, and much more, all of which
could help troubleshoot certain kinds of networking issues. Used without parameters, netstat displays active TCP
connections.
Syntax: NETSTAT [-a] [-b] [-e] [-f] [-n] [-o] [-p proto] [-r] [-s] [-x] [-t] [interval]

Parameters:
-a : Displays all active TCP connections and the TCP and UDP ports on which the computer
is listening.
-b :Displays the executables involved in creating each connection or listening port. Using b over o might seem like it's saving you a step or two but using it can sometimes greatly
extend the time it takes netstat to fully execute.
-e : Displays Ethernet statistics , such as the number of bytes and packets sent and
received. This parameter can be combined with -s.
-f :Displays Fully qualified Domain Names for foreign addresses.
-n : Displays active TCP connections, however, addresses and port numbers are expressed
numerically and no attempt is made to determine names.

- 18 -

EXPERIMENT 3

25th AUGUST 14

-o : Displays active TCP connections and includes the process ID (PID) for each connection.
You can find the application based on the PID on the Processes tab in Windows Task
Manager. This parameter can be combined with -a, -n, and -p.
-p Protocol : Shows connections for the protocol specified by Protocol. In this case,
the Protocol can be tcp, udp, tcpv6, or udpv6. If this parameter is used with -s to display
statistics by protocol, Protocol can be tcp, udp, icmp, ip, tcpv6, udpv6, icmpv6, or ipv6.
-s : Displays statistics by protocol. By default, statistics are shown for the TCP, UDP, ICMP,
and IP protocols. If the IPv6 protocol for Windows XP is installed, statistics are shown for
the TCP over IPv6, UDP over IPv6, ICMPv6, and IPv6 protocols. The -p parameter can be
used to specify a set of protocols.
-r : Displays the contents of the IP routing table. This is equivalent to the route
print command.
-t = Use the -t switch to show the current TCP chimney offload state in place of the typically
displayed TCP state.
-x = Use the -x option to show all NetworkDirect listeners, connections, and shared
endpoints.
-y = The -y switch can be used to show the TCP connection template for all connection. You
cannot use -y with any other netstat option.
Interval : Redisplays the selected information every Interval seconds. Press CTRL+C to stop
the redisplay. If this parameter is omitted, netstat prints the selected information only
once.

- 19 -

EXPERIMENT 3

25th AUGUST 14

Usage:
netstat a : Displays all active TCP connections and the TCP and UDP ports on which the
computer is listening

- 20 -

EXPERIMENT 3

25th AUGUST 14

2: netstat -b p tcp : -b displays the executables involved in creating each connection or


listening port.

- 21 -

EXPERIMENT 3

25th AUGUST 14

3.netstat n p tcp : display active tcp onnection in numerical form

- 22 -

EXPERIMENT 3

25th AUGUST 14

4.netsat o p tcp :PID is displayed

- 23 -

EXPERIMENT 3

25th AUGUST 14

5. netstat r :IP routing table values displayed.

- 24 -

EXPERIMENT 3

25th AUGUST 14

6. netstat y :display template for all connections.

- 25 -

EXPERIMENT 4

1st SEPTEMBER 14

Aim: Make a strait cable using RJ-45 connector and Cat 5e cable
Requirements: Crimping tool , cutter, LAN tester, CAT 5E cable ,2 RJ 45 connectors.
TYPES OF CABLES:
CAT 5: Category 5 cable (Cat 5) is a twisted pair cable for carrying signals. This type
of cable is used in structured cabling for computer networks such as Ethernet. The
cable standard provides performance of up to 100 MHz and is suitable for carrying
signals such as telephony and video.
CAT 5e: The category 5e specification improves upon the category 5 specification by
tightening some crosstalk specifications and introducing new crosstalk specifications
that were not present in the original category 5 specification. The bandwidth of
category 5 and 5e is the same 100 MHz.
Category 5e components are most suitable for a high-speed Gigabit Ethernet. While
Category 5 components may function to some degree in a Gigabit Ethernet, they
perform below standard during high-data transfer scenarios.
CAT 6: Category 6 cable, commonly referred to as Cat 6, is a standardized cable for
Gigabit Ethernet and other network physical layers that is backward compatible with
the Category 5/5e and Category 3 cable standards.[1] Compared with Cat 5 and Cat
5e, Cat 6 features more stringent specifications for crosstalk and system noise.[1] The
cable standard provides performance of up to 250 MHz.

LAN Tester: The LAN Tester assists in the installation and control of networks. This LAN
Tester can be used in the workplace and is ideal for technical service professionals and
network administrators. The LAN Tester determines the IP address, identifies polarity,
identifies connected port and link connectivity.

Signal tester
- 26 -

1st SEPTEMBER 14

EXPERIMENT 4

RJ-45 connector: Short for Registered Jack-45, an eight-wire connector used commonly to
connect computers onto a local-area networks (LAN).

RJ45 connector

Straight cable color code

Straight Cable
Usually use straight cable to connect different type of devices. This type of cable will be
used most of the time and can be used to:
1) Connect a computer to a switch/hub's normal port.
2) Connect a computer to a cable/DSL modem's LAN port.
3) Connect a router's WAN port to a cable/DSL modem's LAN port.
4) Connect a router's LAN port to a switch/hub's uplink port. (Normally used for expanding
network)
5) Connect two switches/hubs with one of the switch/hub using an uplink port and the
other one using normal port.
If you need to check how straight cable looks like, it's easy. Both sides (side A and side B) of
cable have wire arrangement with same color.

- 27 -

EXPERIMENT 4

1st SEPTEMBER 14

Crossover Cable
Sometimes you will use crossover cable, it's usually used to connect same type of devices. A
crossover cable can be used to:
1) Connect two computers directly.
2) Connect a router's LAN port to a switch/hub's normal port. (Normally used for expanding
network)
3) Connect two switches/hubs by using normal port in both switches/hubs.
In you need to check how crossover cable looks like, both side (side A and side B) of cable
have wire arrangement with following different color.
This cable (either straight cable or cross cable) has total 8 wires (or we can say lines), i.e.
four twisted pairs (4x2=8) with different color codes. Right now just forget about color
codes. It doesnt matter what color is given to the cable (but there is a standard).
Cross cable colour coding:

Fig: cross cable colour code


Procedure :1. Start by stripping off about 2 inches of the plastic jacket off the end of cable and check
wires for cut or nicks. If there are any, whack off the whole end and start over.
2. Spread the wires apart and arrange them according to standard colour coding schemes.
3.Even out the wires strands using crimping tool.
- 28 -

EXPERIMENT 4

1st SEPTEMBER 14

4.Put the wire in RJ-45 connector and crimp them.


5.Now check the wire using a LAN tester by inserting one end in one port and the other end
in the other port.
6.If all the eight lights glow in succession then the wire is ready for use.
Precautions:
1.Wire should be stripped properly without cuts on surface.
2. Crimping should be done carefully.
Result:
The straight cable was constructed using RJ-45 connector successfully

- 29 -

EXPERIMENT 5

15 SEPTEMBER 14

AIM: To study DES-3526 switch configuration


Specifications: DES-3526

Interface

24 10/100Base-Tx ports
2 combo 1000Base-T / SFP uplinks
Switch fabric: 8.8Gbps

Stack Integration

Virtual stack of up to 32 units


Embedded D-Link Single IP Management (SIM)

Security

Layer 2/3/4 multi-layer Access Control


External RADIUS/TACACS+ authentication support
SH/SSL support (secure socket layer support for end to end security)
Zone Defense functionality with D-Link firewalls (DFL-800/1600/2500/M510)
Safeguard Engine

Quality of Service

802.1p Priority Queues/Multi-Layer CoS


IP Multicast support for bandwidth-intensive applications
Port bandwidth control.

Traffic Monitoring

Traffic segmentation
802.3ad Link Aggregation (Port Trunks)
GUI Traffic Monitoring
RMON support

- 30 -

EXPERIMENT 5

15 SEPTEMBER 14

Configuration/Management

Web-based configuration/management
Command Line Interface (CLI)
SNMP v.1, v.2c, v.3 Standard
D-View SNMP Network Management Module Provided
Telnet Server

Opening the hyper terminal :

Programs>Accessories> Communication> HyperTerminal


Login to hyperterminal

Command 1: help
Type help
The various commands are : clear ,config, create ,delete, dir ,disable ,download, enable, login, ping
, reboot , reconfig , reset, save, show, telnet, upload.
Screenshot:

- 31 -

EXPERIMENT 5

15 SEPTEMBER 14

Command 2 : config

Config ports : used to configure the serial ports on switch .only specifies ports will be affected.

-Syntax:config ports[portslist/all]{speed[auto/10_half/10_full /100_half/100_full/


1000_half/1000_full]learning[enable/disable]state [enable/disable].
-Only admin level user can operate or use this command.

- 32 -

EXPERIMENT 5

15 SEPTEMBER 14
USAGE

- 33 -

EXPERIMENT 5

15 SEPTEMBER 14

Command :show
This command is used to display current configuration information about ports , logs, firmware etc.

Usage:
show ports [<portslist>] :

- 34 -

EXPERIMENT 5

Show time : shows current system time

Show log : displays current system log information

15 SEPTEMBER 14

- 35 -

EXPERIMENT 5

15 SEPTEMBER 14

Show firmware :

- 36 -

EXPERIMENT 6

OCTOBER 14

AIM : To write a program to check parity and hamming distance.


Theory: In communications, parity checking refers to the use of parity bits to check that data has been
transmitted accurately. The parity bit is added to every data unit (typically seven or eight bits ) that are
transmitted. The parity bit for each unit is set so that all bytes have either an odd number or an even
number of set bits. A parity bit, or check bit is a bit added to the end of a string of binary code that
indicates whether the number of bits in the string with the value one is even or odd. Parity bits are used as
the simplest form of error detecting code.

Code :
#include<iostream>
#include<string>
using namespace std ;
int main()
{
string s;
//input string
cout<<"enter the input";
cin>>s;
cout<<s;
int i,cnt=0;
//compare for 1
for(i=0;i<s.length();i++)
{
if(s[i]=='1')
cnt++;
}
//check for even or odd
if(cnt%2==0)
cout<<"\neven parity";
else
cout<<"\nodd parity";
}

- 37 -

EXPERIMENT 6

OCTOBER 14
OUTPUT

Hamming Distance :
The Hamming distance between two strings of equal length is the number of positions at which the
corresponding symbols are different. In another way, it measures the minimum number
of substitutions required to change one string into the other, or the minimum number of errors that could
have transformed one string into the other.
Code :
#include<iostream>
#include<string>
using namespace std ;
int main()
{
string s1, s2 ,s3;
int i,cnt=0,n=0;
cout<<"Enter the input 1 \n";
cin>>s1;
cout<<"\nEnter the input 2 \n";
cin>>s2;
if(s1.length() < s2.length())
{
- 38 -

EXPERIMENT 6

OCTOBER 14

n=s2.length()-s1.length();
for(i=0;i<n;i++)
{
s3+='0';
}
s3=s3+s1;
for(i=0;i<s1.length();i++)
{
if(s1[i]==s3[i])
{
cnt++;
}
}
}
else
{
n=s1.length()-s2.length();
for(i=0;i<n;i++)
{
s3+='0';
}
s3=s3+s2;
for(i=0;i<s2.length();i++)
{
if(s1[i]==s3[i])
{
cnt++;
}
}
}
cout <<"The hamming distance is : "<<cnt <<endl;
}

OUTPUT

- 39 -

EXPERIMENT 7

OCTOBER 14

AIM : To write a program for cyclic redundancy check .


Theory: A cyclic redundancy check (CRC) is an error-detecting code commonly used in digital networks and
storage devices to detect accidental changes to raw data. Blocks of data entering these systems get a
short check value attached, based on the remainder of a polynomial division of their contents; on retrieval
the calculation is repeated, and corrective action can be taken against presumed data corruption if the
check values do not match.
The CRC polynomial should follow the rule that it should not be divisible by x but it must be divisible by
x+1.
We use here is CRC-8 defined as :
CRC-8, C(x) = x8 + x2 + x + 1,
CODE :
#include<iostream>
#include<string>
using namespace std;
int exoring(int,int);
int main()
{
int remainder[9],quotient[30];
int divisor[9]={1,0,0,0,0,0,1,1,1};
string mes,div;
cout<<"Enter input message :";
cin>>mes;
int n=mes.length();
int message[n];
int i;
for(i=0;i<n;i++)
{
message[i]=mes[i]%2;
}
while(i<n+8)
{
message[i]=0;
i++;
}
for(i=0;i<8;i++)
{
remainder[i]=message[i];
}
int z=0;
for(int i=9;i<n+8;i=i++)
{
if(remainder[0]==1)
{quotient[z]=1;
for(int k=0;k<9;k++)
remainder[k]=exoring(remainder[k],divisor[k]);
}
- 40 -

EXPERIMENT 7

OCTOBER 14

else
quotient[z]=0;
if(remainder[0]==0)
{
for(int k=0;k<8;k++)
remainder[k]=remainder[k+1];
remainder[8]=message[i];
}
z++;
}
for(int j=0;j<9;j++)
{
cout<<remainder[j];
}
cout<<endl;
for(int j=0;j<n;j++)
{
cout<<quotient[j];
}
}
int exoring(int a,int b)
{
if(a==b)
return 0;
else
return 1;
}
OUTPUT :

- 41 -

- 42 -

Das könnte Ihnen auch gefallen