Documente Academic
Documente Profesional
Documente Cultură
Lab Manual
B. E. SEMESTER-VIII
List of Experiments
1
To perform byte transfer between 2 PCs using serial port (using C code)
To perform simple file transfer between 2 PCs using serial port (using C code)
10
11
12
EXPERIMENT 1
Introduction to LAN cabling scheme & crimping process
Signal
EIA/TIA 568A
EIA/TIA 568B
Ethernet
Transmit +
White/Green
White/Orange
Transmit -
Green/White or
Green
Orange/White or
Orange
Receive +
White/Orange
White/Green
N/A
Blue/White or
Blue
Blue/White or
Blue
Not Used
N/A
White/Blue
White/Blue
Not Used
Receive -
Orange/White or
Orange
Green/White or
Green
N/A
White/Brown
White/Brown
Not Used
N/A
Brown/White or Brown/White or
Brown
Brown
Wiring/Color Coding for CAT5 Cable
Not Used
TUTORIAL Questions
1) What are hubs and repeaters?
2) How many types of LED indicators are there at back panel of a Hub? What is their
significance?
3) What is the need of an uplink feature in a Hub?
4) What is an NIC card?
5) What is maximum length that category 5 up cable support?
6) What is the difference between a router and a repeater or a bridge?
7) There are how many types of connecting devices?
8) In which layer/layers does the repeater function?
9) In which layer/layers does the router function?
10) What do you mean by 10BASE5?
11) What is the meaning of T in 10BASE-T?
12) What is a crossover cable?
13) What is power consumption for DE 816TP hub?
14) What is the function of Collision LED?
EXPERIMENT 2
Introduction to RS 232C & UART
Objectives
[A]
To understand RS232-C standard and UART functions.
To study RS232-C cabling scheme.
To test RS232-C cable using Windows inbuilt utility.
[B]
To verify serial port communication between two PCs by writing simple C code. (byte
transfer).
To implement byte transfer using ALP.
Concept
In most cases, any device you connect to the serial port will need the serial transmission
converted back to parallel so that it can be used. This can be done using a UART. On
software side, there are many more registers that you have to attend to than on a Standard
Parallel Port. (SPP)
What are the advantages of using serial data transfer rather than parallel?
Serial Cables can be longer than Parallel cables. The serial port transmits a '1' as -3 to -25
volts and a '0' as +3 to +25 volts where as a parallel port transmits a '0' as 0v and a '1' as
5v. Therefore the serial port can have a maximum swing of 50V compared to the parallel
port which has a maximum swing of 5 Volts. Therefore cable loss is not as much of a
problem for serial cables then they are for parallel.
You don't need as many wires then parallel transmission. If your device needs to be
mounted a far distance away from the computer then 3 core cable (Null Modem
Configuration) is going to be cheaper that running 19 or 25 core cable. However you
must take into account the cost of the interfacing at each end.
Many electronic diaries and palmtop computers have infra red capabilities build in.
Serial transmission is used where one bit is sent at a time. IrDA-1 (The first infra red
specifications) was capable of 115.2k baud and was interfaced into a UART. The pulse
length however was cut down to 3/16th of an RS 232 bit length to conserve power
considering these devices are mainly used on diaries, laptops and palmtops.
Serial Communication reduces the pin count of Microcontrollers. Only two pins are
commonly used, Transmit Data (TXD) and Receive Data (RXD) compared with at least
8 pins if you use an 8 bit Parallel method (You may also require a Strobe).
Hardware Properties
Devices which use serial cables for their communication are split into two categories.
These are DCE (Data Communications Equipment) and DTE (Data Terminal
Equipment.) Data Communications Equipments are devices such as your modem, TA
adapter, plotter etc while Data Terminal Equipment is your Computer or Terminal
The electrical specifications of the serial port are contained in the RS232C standard. It
states many parameters such as
1.
2.
3.
4.
The RS 232 C standard specifies a maximum baud rate of 20,000 BPS. Serial Ports come
in two "sizes". There are the D-Type 25 pin connector and the D-Type 9 pin connector
both of which are male on the back of the PC, thus you will require a female connector on
your device. Below is a table of pin connections for the 9 pin and 25 pin D-Type
connectors.
Serial Pin outs (D25 and D9 Connectors)
D-Type-25 Pin No. D-Type-9 Pin No.
Pin 2
Pin 3
Pin 3
Pin 2
Pin 4
Pin 7
Pin 5
Pin 8
Pin 6
Pin 6
Pin 7
Pin 5
Pin 8
Pin 1
Pin 20
Pin 4
Pin 22
Pin 9
Abbreviation
TD
RD
RTS
CTS
DSR
SG
CD
DTR
RI
Full Name
Transmit Data
Receive Data
Request To Send
Clear To Send
Data Set Ready
Signal Ground
Carrier Detect
Data Terminal Ready
Ring Indicator
Pin Functions
Abbreviation
TD
RD
CTS
Full Name
Transmit Data
Receive Data
Clear to Send
DCD
DSR
DTR
RTS
Request To Send
RI
Ring Indicator
Function
Serial Data Output (TXD)
Serial Data Input (RXD)
This line indicates that the Modem is ready to
exchange data.
When the modem detects a "Carrier" from the
modem at the other end of the phone line, this Line
becomes active.
This tells the UART that the modem is ready to
establish a link.
This is the opposite of DSR. This tells the Modem
that the UART is ready to link.
This line informs the Modem that the UART is
ready to exchange data.
Goes active when modem detects a ringing signal
from the PSTN.
Null Modems
A Null Modem is used to connect two DTE's together without using intermediate DCEs..
9D to 25D Conversion
Address
3F8
2F8
3E8
2E8
IRQ
4
3
4
3
Above is the standard port addresses. These should work for most PC's. If you just happen to
be lucky enough to own a IBM P/S2 which has a micro-channel bus, then expect a different
set of addresses and IRQ's. Just like the LPT ports, the base addresses for the COM ports can
be read from the BIOS Data Area.
Start Address
Function
0000:0400
COM1's Base Address
0000:0402
COM2's Base Address
0000:0404
COM3's Base Address
0000:0406
COM4's Base Address
COM Port Addresses in the BIOS Data Area;
The above table shows the address at which we can find the Communications (COM) ports
addresses in the BIOS Data Area. Each address will take up 2 bytes.
Registers
RBR, THR, IER, IIR, FCR, LCR, MCR, LSR, MSR, SCR, DLL, DLM
The communication between the processor and the UART is completely controlled by
twelve registers. These registers can be read or written to check and change the behavior of
the communication device. Each register is eight bits wide. On a PC compatible, the
registers are accessible in the I/O port map.
RBR: Receiver buffer register (RO)
The receiver buffer register contains the byte received if no FIFO is used, or the oldest
unread byte with Fifes. If FIFO buffering is used, each new read action of the register
will yield the next byte, until no more bytes are present. Bit 0 in the line status register
can be used to check if all received bytes have been read. This bit will change to zero if
no more bytes are present.
THR: Transmitter holding register (WO)
The transmitter holding register is used to buffer outgoing characters. If no FIFO
buffering is used, only one character can be stored. Otherwise the amount of characters
depends on the type of UART. Bit 5 in the line status register can be used to check if
new information must be written to the transmitter holding register. The value 1
indicates that the register is empty. If FIFO buffering is used, more than one character
can be written to the transmitter holding register when the bit signals an empty state.
There is no indication of the amount of bytes currently present in the transmitter FIFO.
The transmitter holding register is not used to transfer the data directly. The byte is first
transferred to a shift register where the information is broken in single bits which are
sent one by one.
LCR: Line control registers (R/W)
The line control register is used at initialization to set the communication parameters.
Parity and number of data bits can be changed for example. The register also controls
the accessibility of the DLL and DLM registers. Because they are only accessed at
initialization when no communication occurs this register swapping has no influence on
performance.
Common settings are:
8 data bits, one stop bit, no parity
7 data bits, one stop bit, even parity
Value
Bit 1
Bit 0
5 Bits
6 Bits
7 Bits
8 Bits
0
1
3,4,5
Detail
Bit 5
1 stop bit
1.5 stop bits(5 bits word)
2 stop bits (6,7 or 8 bit word)
Bit 4
Bit 3
No parity
Odd Parity
Even Parity
High Parity(stick)
Low Parity(stick)
Comment
Data available
Overrun error
Parity error
Framing error
THR is empty
Divisor
DLL
DLM
50
2304
0x00
0x09
300
384
0x80
0x01
1200
96
0x60
0x00
2400
48
0x30
0x00
4800
24
0x18
0x00
9600
12
0x0C
0x00
19200
0x06
0x00
38400
0x03
0x00
57600
0x02
0x00
115200
0x01
0x00
Table of Registers
Base Address DLAB Read/Write Abr. Register Name
=0
Write
=0
Read
Receiver Buffer
=1
Read/Write -
=0
=1
Read/Write -
Read
IIR
Write
+3
+4
+5
Read
+6
Read
+7
Read/Write -
+0
+1
+2
Scratch Register
Exercise
1. Prepare 9 9 pin serial cables with null modem configuration.
2. Load divisors in DLM & DLL to support communication at 9600 bps. After
configuration restore transmission mode.
3. Check functioning of prepared cable using Direct Cable Communication under
windows.
4. Perform simple byte transfer between 2 PCs through serial ports connected via serial
cable tested in previous exercise. (Using C program)
EXPERIMENT 3
To perform byte transfer between 2 PCs using serial port (using C code)
EXPERIMENT 4
To perform simple file transfer between 2 PCs using serial port (using C code)
EXPERIMENT 5
Study and execution of Network commands
Objectives
To test different network utilities like ping, tracert, arp, ipconfig, ftp
To study and use different options for these utilities
Concepts
(1) PING (Packet Internet Groper Command)
If any system (host or router) want to communicate with the other system (host or route) then
it is necessary to check the communication is possible or not? For this, First of all we have to
check for destination system is reachable or not. Due to hardware failure or any other reason
it is possible the system may on network but not reachable. How can we detect that the
destination system is reachable or not? PING command is useful for checking the reach
ability of the system.
Procedure:
First go to command prompt
For help and information about this command type ping /?
Type ping IP address of system
Example:
(2) TRACERT:
When one system (host or router) send the packet of data to another system then there be two
possibilities, Packet directly reach to destination system or it pass through one or more
routers. TRACERT command is useful to trace the route through which packet passes.
Procedure:
First go to command prompt
For help and information about this command type tracert /?
Type tracert IP address or name of the destination.
Example:
(3) IPCONFIG:
When System is in network at that time it is necessary to know the IP address of that system,
subnet mask and gateway address IPCONFIG command is used.
Procedure:
First go to command prompt
For help and information about this command type ipconfig /?
Type ipconfig.
Example:
Example:
TUTORIAL Questions
(1) Which protocol is used in PING command?
(2) Explain briefly about each field received in reply while using PING command.
(3) Is it possible to find IP address of the system on which you are working using PING
command?
(4) Which kind of ICMP messages used in PING command?
(5) What is maximum size of a packet practically? Prove it using PING command?
(6) State the minimum number of hop count is requiring for checking reach ability of host?
(7) Which message will display while hop count is less than the number of routers on the
path.
(8) Which protocol is used in TRACERT command?
(9) If more than one router in the route than first reply comes from which router while using
TRACERT?
(10) If final destination is not reachable than how many reply comes while using TRACERT
command?
(11) Explain briefly about each field in an ARP table.
(12) Explain briefly about each field displayed while running ipconfig command.
(13) Which information we get from subnet mask?
(14) Write subnet mask for class A, class B, class C and class D addresses.
(15) If one router on the path to reach the final destination How can we find the IP address of
the two interfaces of the router?
EXPERIMENT 6
Study of Network planning and setup (e.g. - GEC-Rajkot)
EXPERIMENT 7
Study of Networking and Internetworking devices
Objectives
To study network devices and the specifications of each for existing network
plan
To study existing network plan
To draw a new network plan as per the new constraints
Concepts
Local area networks generally called LANs are privately owned networks within a single
building or campus or up to few kilometers in size. They are widely used to connect personal
computers and workstations in company offices and factories to share resources and
exchange information. LANs are distinguished from other kinds of networks by three
characteristics.
1) Transmission media
2) Transmission mechanism
3) Topology
4) Protocol
A Local area network is a data communication system that allows a number of independent
devices to communicate directly with each other in a limited geographic area such as single
department, single building, or campus. A large organization may need several connected
LANs.
Implementations
The IEEE standard defined several implementations for Internet
Implementation
10BASET
10BASE2
10BASE5
10BASE-FL
Maximum
Supported
100 m
200 m
500 m
2000 m
Distance
Connecting Devices
Repeaters
A repeater is a device that operates only in the physical layer. A repeater receives a signal
before it becomes too weak or corrupted and regenerates the original signal. A repeater can
extend the physical length of a network. A repeater connects segments of LAN together. It
has no filtering capability.
Hubs
A hub is a multiport repeater. It is used to create connections in physical star topology.
Hub
Hub
Nodes.
Hub
Nodes ..
Bridges
A bridge operates in both physical layer and data link layers. As a physical layer device it
regenerates the signal it receives. As a data link layer device the bridge can check the
physical address contained in the packet. A bridge like a repeater has no physical address. It
only acts as a filter, not an original sender to a final destination. Filtering means that it can
check the destination address of a packet and decide if the packet should be forwarded or
dropped.
Switches
A two layer switch is a bridge with many interfaces and a design that allows better
performance. A three layer switch is router with an improved design to allow better
performance.
When a packet is received by the switch, the switch examines the destination and source
hardware addresses and compares them to a table of network segments and addresses. If the
segments are the same, the packet is dropped ("filtered"); if the segments are different, then
the packet is "forwarded" to the proper segment. Filtering of packets and the regeneration of
forwarded packets enables switching technology to split a network into separate collision
domains. Regeneration of packets allows for greater distances and more nodes to be used in
the total network design, and dramatically lowers the overall collision rates. In switched
networks, each segment is an independent collision domain. Switches can connect different
networks types (such as Ethernet and Fast Ethernet) or networks of the same type.
Routers
Router is a three layer device; it operates in physical, data link and network layers. As a
physical layer device, it regenerates the signal it receives. As a data link layer device the
router checks the physical addresses (source and destination) contained in the packet. As a
network layer device, a router checks the network layer addresses.
A Router can connect LANs together, a router can connect WANs together and it can also
connect LANs and WANs together. A router is an internetworking device.
Gateways
Many networks exist in the world, often with different hardware & software. People
connected to one network often want to communicate with people attached to a different one.
This desire requires connecting together different and frequently incompatible networks. This
is done by using machines called gateways to make the connection and provide the necessary
translation, both in terms of hardware and software. Stopping point can be either a gateway
node. It can also be referred as entrance point.
Network Interface Cards
A network interface card (NIC) is used to connect a PC to a network. NIC provides a physical
connection between the networking cable and the computers internal bus. NIC comes in 3
basic varieties.8 bit, 16 bits and 32 bits. The larger the number of bits faster the NIC.
CAT Cabling
Ethernet networks use unshielded twisted pair (UTP) Category 5 cable. CAT5 cable runs
should not exceed 100 meters.
CAT5 cables are typically terminated with RJ-45 connectors. There are two different types of
RJ-45 connectors. There is the "bent type" connector intended for use with solid core CAT5,
and then there is the "aligned type" connector for use with stranded CAT5 cable.
Two types of CAT5 cables are typically used in a network: the straight-through cable and the
crossover cable. The difference between the two has to do with how the conductors terminate
to the RJ-45 connector at each end of the cable. The chart below shows the RJ-45 connector
"pin-outs" for CAT5 crossover and straight-through cables.
RJ-45 Connector "Pin-Outs". A straight-through cable is used to connect a DTE to a switch.
Crossover cables are used to connect switches to other switches. . If the wiring is identical at
both ends, you are holding a straight-through cable, if it is different; you most likely have a
crossover cable.
Access Technique for LAN
CSMA-CD
The IEEE 802.3 standard defines carrier sense multiple access with collision detection as the
access method for Ethernet. Stations on an Ethernet can be connected together using a
physical star topology with a logical bus topology. By this we mean that the medium is
shared between the stations and only one station at a time can use it. It also implies that all
stations receive a frame sent by a station. The real destination keeps the frame while the rest
drop it.
CSMA-CD stands for Carrier Sense Multiple Access / Collision Detection, a set of rules
determining how network devices respond when two devices attempt to use a data channel
simultaneously (called a collision). Standard Ethernet networks use CSMA/CD. This standard
enables devices to detect a collision. After detecting a collision, a device waits a random
delay time and then attempts to re-transmit the message.
10 Mbps
CSMA/CD
Star, Bus
DE-812TP+ and DE-824TP:
FCC Class A, VCCI I, CE A
DE-816TP:
FCC Class B, VCCI II, CE B
AC power:
100 - 250 V, 50 - 60 Hz
Power consumption:
DE-812TP+: 18 W
DE-816TP: 18 W
DE-824TP: 20W
Dimensions:
W x H x L, mm (including
mounting brackets):
DE-812TP+: 483 x 44 x 125
DE-816TP: 483 x 44 x 125
DE-824TP 483 x 44 x 211
Weight:
DE-812TP+: 2.0 kg
DE-816TP: 2.0 kg
DE-824TP: 3.03 kg
Operating temperature:
0 - 55 C
Humidity:
10 - 90 % non-condensing
Power cord:
Type 2
Plug Rating
125V, 7A
250V, 10A
Cord Rating
125V, 7A
250V, 10A
Length
1830mm (6ft)
1830mm (6ft)
Safety Standard
UL, CSA
VDE
EXPERIMENT 8
To find out details of network from IP addressing scheme (using C code)
TUTORIAL Questions
(1) A device can have more than one IP addresses-true or false, justify your answer.
(2) What is the use of Loopback address?
(3) IP addresses are unique- true or false, justify your answer.
(4) Which version of IP addressing scheme is currently in use and what could be the future
expansion in the IP addressing scheme?
(5) What is meant by Net ID and Host ID?
(6) An address space has a total 1024 addresses, how many bits are needed to represent an
address?
(7) A router has an IP address 108.5.18.22; it sends a direct broadcast packet to all hosts
in this network. What are the source and destination addresses used in this packet?
(8) A host with IP address 185.42.56.88 wants to use Loopback testing what are the source
and destination addresses?
EXPERIMENT 9
To perform encryption on data (using C code)
EXPERIMENT 10
Demonstration of Linux OS installation and network utilities
EXPERIMENT 11
Study of internet packet capturing tool - Ethereal
WHAT IS ETHEREAL?
Ethereal is a network packet analyzer. A network packet analyzer will try to capture network
packet and tries to display that packet data as detailed as possible.
One could think of a network packet analyzer as a measuring device used to examine what's
going on inside a network cable, just like a voltmeter is used by an electrician to examine
what's going on inside an electric cable (but at a higher level, of course).
In the past, such tools were either very expensive, proprietary or both. However, with the
advent of Ethereal, all that has changed.
Ethereal is perhaps one of the best open source packet analyzers available today.
Features:
The following are some of the many features Ethereal provides:
Available for UNIX and Windows.
Capture live packet data from a network interface.
Display packets with very detailed protocol information.
Open and Save packet data captured.
Import and Export packet data from and to a lot of other capture programs.
Filter packets on many criteria.
Linux:
Debian GNU/Linux
Gentoo Linux
IBM S/390 Linux (Red Hat)
Mandrake Linux
PLD Linux
Red Hat Linux
Rock Linux
Slackware Linux
Suse Linux
Microsoft Windows:
Windows Me / 98 / 95
Windows Server 2003 / XP / 2000 / NT 4.0
Appliance was looking for something better than tcpview, so he started applying patches and
contributing dissectors to Ethereal.
Installing Ethereal:
As with all things, there must be a beginning, and so it is with Ethereal. To use Ethereal, you
must:
Obtain a binary package for your operating system, or
Obtain the source and build Ethereal for your operating system.
The following are the general steps you would use:
1. Download the relevant package for your needs, e.g. source or binary distribution.
2. Build the source into a binary, if you have downloaded the source.
This may involve building and/or installing other necessary packages.
3. Install the binaries into their final destinations
2. By starting Ethereal and then selecting Start... from the Capture menu (or use the
corresponding item in the "Main" toolbar), this brings up the Capture Options dialog box.
The "Capture Options" dialog box
When you select Start... from the Capture menu, Ethereal pops up the "Capture Options"
dialog box
as shown in figure below.
Running Capture:
While the capture is running, the following dialog box is shown:
This dialog box will inform you about the number of captured packets and the time since the
capture
EXPERIMENT 12
Network Simulator-ns-2: Installation, Programming & Simulation demonstration
o To study various features of Network Simulator & Network Emulator
o To test a given script on Network Simulator platform and observe the behavior
of the network with the help of the key parameters
o To measure the performance of a network for a given topology
o To understand the network setup with a network emulator
o To implement different types of link characteristics and measure the
performance by changing various parameters using NIST Net
Concepts
Network Simulator is a very powerful tool for studying the working of layers and related
protocols. Though it is giving protocol stack independent performance, which is an
advantage, but it is highly recommended by researchers around the world. Its simulated
output is considered to be valid for most of real protocol implementations.
Network Simulator includes The Network Animator, which is helping Network Simulator to
support a graphical environment. The Network Animator uses the parameters from the script
and writes it into .nam file and then according to that it will create a topology identical to the
script. So we can see graphically how the packets are forwarded and traffic is handled in the
network, so this can give the more realistic implementation and observation.
Network Simulator uses tcl script for simulation. Syntax of this script can be understood by
referring the NS_DOC.PDF
We can understand Network Simulators simulation process and tcl script format and The
Network Animator graphical representation with the help of the following scripts:
UDP
#Create a simulator object
set ns [new Simulator]
#Define different colors for data flows
$ns color 1 Blue
$ns color 2 Red
#Open the nam trace file
set nf [open out.nam w]
$ns namtrace-all $nf
#Define a 'finish' procedure
proc finish {} {
global ns nf
$ns flush-trace
#Close the trace file
close $nf
#Execute nam on the trace file
OUTPUT:-
Installation Procedure
(1)
(2)
(3)
(4)
(5)