DCC Lab Manual - 2020-2021
DCC Lab Manual - 2020-2021
B. Tech.
PART II DATASHEETS
LABORATORY MANUAL
EXPERIMENT 1
OBJECTIVES:
(i) To understand RS232-C standard and UART functions.
(ii) To study RS232-C cabling scheme.
(iii) To test RS232-C cable using Windows inbuilt utility.
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)
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
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 1
Table1.1 RS232 standard parameters
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.
Pin Functions
Table1.3 Pin Function of D9 Pin Connector
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 2
DTR Data Terminal Ready This is the opposite of DSR. This tells the Modem that the
UART is ready to link.
RTS Request To Send This line informs the Modem that the UART is ready to
exchange data.
RI Ring Indicator 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
UART stands for Universal Asynchronous Receiver / Transmitter. UART 8250 is the device that
controls the serial port. Most cards will have the UART's integrated into other chips which may
also control your parallel port, games port, floppy or hard disk drives and are typically surface
mount devices. The 8250 series, which includes the 16450, 16550, 16650, & 16750 UARTS are
the most commonly found type in your PC.
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 3
All the UARTs pins are TTL compatible. That includes TD, RD, RI, DCD, DSR, CTS, DTR and
RTS which all interface into your serial plug, typically a D-type connector. Therefore RS 232
Level Converters are used.
The UART requires a Clock to run. If you look at your serial card a common crystal found is
either a 1.8432 MHZ or an 18.432 MHZ Crystal. This clock will be used for the Programmable
Baud Rate Generator which directly interfaces into the transmit timing circuits but not directly
into the receiver timing circuits. For this an external connection mast be made from pin 15 (Baud
Out) to pin 9 (Receiver clock in.) Note that the clock signal will be at Baud rate * 16.
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.
The receiver buffer register contains the byte received if no FIFO is used, or the oldest unread
byte with Fife
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.
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.
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
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 4
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.
The line status register shows the current state of communication. Errors are reflected in this
register. The state of the receiver and transmitter buffers is also available.
Bit Comment
0 Data available
1 Overrun error
2 Parity error
3 Framing error
4 Break signal received
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 5
5 THR is empty
6 THR is empty, and line is idle
7 Erroneous data in FIFO
Bit 5 and 6 both show the state of the transmitting cycle. The difference is, that bit 5 turns high
as soon as the transmitter holding register is empty whereas bit 6 indicates that also the shift
register which outputs the bits on the line is empty
The frequency (1.8432 MHz) is divided by 16 to generate the time base for communication.
Because of this division, the maximum allowed communication speed is 115200 bps. Modern
UARTS like the 16550 are capable of handling higher input frequencies up to 24 MHz which
makes it possible to communicate with a maximum speed of 1.5 Mbps. This 115200 bps
communication speed is not suitable for all applications. To change the communication speed,
the frequency can be further decreased by dividing it by a programmable value. For very slow
communications, this value can go beyond 255. Therefore, the divisor is stored in two
separate bytes, the DLL and DLM which contain the least, and most significant byte.
It is necessary that both the transmitting and receiving UART use the same time base. Default
values have been defined which are commonly used. The table shows the most common
values with the appropriate settings of the divisor latch bytes.
CONLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 6
EXPERIMENT 2
OBJECTIVE:
(i) To verify serial port communication between two PCs by writing simple C code.(Byte
transfer)
#include<unistd.h>
#include <stdio.h>
#include <sys/io.h>
int main( ){
char data;
ioperm(0x3f8,7,1);
outb(0x83,0x3fb);
outb(0x0c,0x3f8);
outb(0x00,0x3f9);
outb(0x03,0x3fb);
while(((inb(0x3fd)) & 0x01)!=0x01);
data=inb(0x3f8);
printf("data received=%c",data);
}
CONLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 7
EXPERIMENT 3
OBJECTIVES:
(i) Implement simple file transfer utility
(ii) Implementation of file transfer with Framing techniques (character count / character
stuffing)
#include<unistd.h>
#include<stdio.h>
#include<sys/io.h>
int main()
{
FILE *f1;
char c;
ioperm(0x3f8,7,1);
outb(0x83,0x3fb);
outb(0x0c,0x3f8);
outb(0x00,0x3f9);
outb(0x03,0x3fb);
f1=fopen("tx.txt","r");
do
{
while((inb(0x3fd) & 0x60)!=0x60);
c=getc(f1);
outb(c,0x3f8);
printf("%c",c);
}while(c!=EOF);
fclose(f1);
printf("\nthe file transmitted\n");
}
#include<stdio.h>
#include<sys/io.h>
#include<unistd.h>
int main()
{
FILE *f1;
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 8
char ch;
ioperm(0x3f8,7,1);
outb(0x83,0x3fb);
outb(0x0c,0x3f8);
outb(0x00,0x3f9);
outb(0x03,0x3fb);
f1=fopen("Rx.txt","w");
do
{
while(((inb(0x3fd)) & 0x01)!=0x01);
ch=inb(0x3f8);
putc(ch,f1);
printf("%c",ch);
}while(ch!=EOF);
fclose(f1);
printf("\nTHE FILE RECEIVED\n");
}
MODIFICATION :
CONLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 9
EXPERIMENT - 4
OBJECTIVE:
(i) Implement character stuffing & de-stuffing concept
#include<unistd.h>
#include<stdio.h>
#include<sys/io.h>
#define DLE 0x10
#define STX 0x02
#define ETX 0x03
int main()
{
FILE *f1;
char a[20];
int i=2,flag=0,j;
ioperm(0x3f8,7,1);
outb(0x83,0x3fb);
outb(0x0c,0x3f8);
outb(0x00,0x3f9);
outb(0x03,0x3fb);
f1=fopen("Tx.txt","r");
do
{
a[0]=DLE;
a[1]=STX;
i=2;
j=0;
while((j<8) && (flag==0))
{
a[i]=getc(f1);
if (a[i]==EOF)
flag=1;
if (a[i]==DLE)
{
i++;
a[i]=DLE;
}
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 10
i++;
j++;
}
a[i]=DLE;
i++;
a[i]=ETX;
j=0;
do
{
while((inb(0x3fd) & 0x60)!=0x60);
outb(a[j],0x3f8);
printf("%c",a[j]);
j++;
}while(j<(i+1));
}while(flag!=1);
printf("\nthe file transmitted\n\n");
}
#include<unistd.h>
#include<stdio.h>
#include<sys/io.h>
#define DLE 0x10
#define STX 0x02
#define ETX 0x03
int main()
{
FILE *f1;
char a[20];
int i,j,flag=0;
ioperm(0x3f8,7,1);
outb(0x83,0x3fb);
outb(0x0c,0x3f8);
outb(0x00,0x3f9);
outb(0x03,0x3fb);
f1=fopen("hp6.txt","w");
do
{ i=0;
do
{
while(((inb(0x3fd)) & 0x01)!=0x01);
a[i]=inb(0x3f8);
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 11
i++;
}while(a[i-1]!=ETX);
for(j=0;j<i;j++)
{
printf("%c",a[j]);
}
j=0;
while(j<i)
{
if(a[j]==EOF)
flag=1;
CONLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 12
EXPERIMENT 5
OBJECTIVES:
(i) To implement simple stop & wait protocol
(ii) To understand the role of timer in the protocol
#include<stdio.h>
#include<conio.h>
#include<dos.h>
void baud( ) /* Baud rate setting */
{
outb(0x83,0x3fb);
outb(0x0c,0x3f8);
outb(0x00,0x3f9);
outb(0x03,0x3fb);
}
void frm_nw_layer( ) /* Go get something to send */
{
int i;
fp=fopen("number.txt",'r');
for (i=0;i<8;i++)
{
data[i]=fgetc(fp);
if (data[i]= =EOF)
{
flag=1;
break;
}
}
fclose(fp);
}
void frame_generate( ) /* To generate a frame */
{
frame[0]=seq; /* Put Seq. No. into frame */
for(i=0;i<8;i++)
{
frame[i+1]=data[i]; /* Put data into frame */
}
frame[i+1]='0';
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 13
if(seq=='1') /* Alter the seq. */
seq='0';
else
seq='1';
}
void to_phy_layer( ) /* Transmit the frame */
{
int i;
status=0;
do
{
for(i=0;i<10;i++)
{
while((inb(0x3fd)&(0x60))!=0x60);
outportb(0x3f8,frame[i]);
}
delay(5000); /* Wait for given delay */
while((inb(0x3fd)&(0x01))!=0x10);
ack=inb(0x3f8);
if(ack= =seq)
{
status=1;
break;
}
}
while(!status= =1 && ack= =seq);
}
char data[8],frame[10];
char seq='0',ack;
FILE *fp;
int status,flag=0,i;
void main( )
{
baud( ); /* Baud rate Setting */
frm_nw_layer( ); /* Go get something to send */
frame_generate( ); /* Get data from network layer and bound
it into frame */
to_phy_layer( ); /* Transmit frame through any physical
medium */
}
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 14
SAMPLE PROGRAM (RECEIVER):
#include<stdio.h>
#include<conio.h>
#include<dos.h>
int flag=0,R=0,i;
char ack,frame[10],data[8];
FILE *fp;
void baud( ) //Baud rate setting
{
outb(0x83,0x3fb);
outb(0x0c,0x3f8);
outb(0x00,0x3f9);
outb(0x03,0x3fb);
}
void fr_phy_layer() //To get the frame from physical layer.
{
int DF;
do
{
DF=0; //Set the Duplicate flag as 0 initially.
for(i=1;i<10;i++)
{
if ((inb(0x3fd)&(0x01))==0x01)
frame[i]=inb(0x3f8);
}
if(frame[9]=='0')
{
if(frame[0]=='0')
ack='1';
if(frame[0]=='1')
ack='0';
if ((inb(0x3fd)&(0x60))==0x60)
outb(ack,0x3f8);
}
if(frame[0]!=R)
{
DF=1;
}
}while(DF!=0);
if(R==0)
R=1;
else
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 15
R=0;
for(i=0;i<8;i++)
{
data[i]=frame[i+1];
}
}
void to_nw_lyr() //Pass the data to Network Layer.
{
for(i=0;i<8;i++)
{
if(data[i]!=EOF)
{
fputc(data[i],fp);
}
else
{
flag=1;
break;
}
}
}
void main()
{
fp=fopen("Rx.txt","w");
do
{
fr_phy_layer(); //Call the function from physical layer.
to_nw_lyr(); //Call the function to network layer.
}while(flag!=1); //Continue untill the flag bit become 1.
fclose(fp); //Close the file.
}
MODIFICATIONS:
CONLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 16
EXPERIMENT 6
IP ADDRESSING
OBJECTIVES:
(i) To implement a program for IP class identification
(ii) To implement a program for IP address conversion (BCD to Binary)
(iii) To implement a program for finding Network ID (with or without subnet mask)and
number of hosts
#include<stdio.h>
int main(){
int i=0;
long bin[4];
int dec[4];
int convert(long);
printf("Enter IP address in binary notation ( separate each byte by space :\n ");
for(i=0;i<4;i++)
{
scanf("%ld",&bin[i]);
dec[i]=convert(bin[i]);
}
printf("IP address in dotted decimal form :\n");
printf("%d.%d.%d.%d",dec[0],dec[1],dec[2],dec[3]);
}
int convert(long data)
{
int power2(int , int);
int sum = 0,i;
for(i=0;data>0;i++)
{
sum+=(data%10)*(power2(2,i));
data = data/10;
}
return sum;
}
int power2(int m , int n)
{
int ans = 1,i;
for(i=1;i<=n;i++)
ans *= m;
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 17
return ans;
}
SAMPLE PROGRAM (DOTTED DECIMAL TO BINARY FORM):
#include<stdio.h>
int main()
{
int i=0;
long bin[4];
int dec[4];
long convert(int);
clrscr();
printf("Enter IP address in dotted decimal notation ( separate each byte by . :\n ");
scanf("%d.%d.%d.%d",&dec[0],&dec[1],&dec[2],&dec[3]);
for(i=0;i<4;i++)
bin[i]=convert(dec[i]);
printf("IP address in pure binary notation :\n");
printf("%08ld %08ld %08ld %08ld",bin[0],bin[1],bin[2],bin[3]);
}
long convert(int data)
{
long power2(long , long);
long sum = 0,i;
for(i=0;data>0;i++)
{
sum+=(data%2)*(power2(10,i));
data = data/2;
}
return sum;
}
long power2(long m , long n)
{
long ans = 1,i;
for(i=1;i<=n;i++)
ans *= m;
return ans;
}
MODIFICATIONS:
(1) Modify the above programs to find network id and host id from entered IP address (either
in binary or dotted decimal form)
(2) Modify the above programs to find class as well as subnet mask of entered IP address.
CONLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 18
EXPERIMENT 7
NETWORK PLANNING
OBJECTIVES:
(i) To study network devices and the specifications of each for existing network plan
(ii) To study existing network plan
(iii) To draw a new network plan as per the new constraints
Hub
A network hub or repeater hub is a device for connecting multiple twisted pair or fiber optic
Ethernet devices together and thus making them act as a single network segment. Hubs work at
the physical layer (layer 1) of the OSI model. The device is thus a form of multiport repeater.
Repeater hubs also participate in collision detection, forwarding a jam signal to all ports if it
detects a collision.
Hubs also often come with a BNC and/or AUI connector to allow connection to legacy 10BASE2
or 10BASE5 network segments. The availability of low-priced network switches has largely
rendered hubs obsolete but they are still seen in older installations and more specialized
applications.
A network hub is a fairly unsophisticated broadcast device. Hubs do not manage any of the
traffic that comes through them, and any packet entering any port is broadcast out on all other
ports. Since every packet is being sent out through all other ports, packet collisions result
which greatly impedes the smooth flow of traffic.
Types of Hubs
1. Passive (A hub which does not need an external power source, because it does not
regenerate the signal and therefore falls as part of the cable, with respect to maximum cable
lengths)
2. Active (A hub which regenerates the signal and therefore needs an external power supply)
3. Intelligent (A hub which provides error detection (e.g. excessive collisions) and also does
what an active hub does)
Passive hubs do not amplify the electrical signal of incoming packets before broadcasting them
out to the network. Active hubs, on the other hand, do perform this amplification, as does a
different type of dedicated network device called a repeater. Another, not so common, name for
the term concentrator is referring to a passive hub and the term multiport repeater is referred to
an active hub.
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 19
Intelligent hubs add extra features to an active hub that are of particular importance to
businesses. An intelligent hub typically is stackable (built in such a way that multiple units can
be placed one on top of the other to conserve space). It also typically includes remote
management capabilities via Simple Network Management Protocol (SNMP) and virtual LAN
(VLAN) support.
Uses
For inserting a protocol analyzer into a network connection, a hub is an alternative to a network
tap or port mirroring.
Some computer clusters require each member computer to receive all of the traffic going to the
cluster A hub will do this naturally; using a switch requires special configuration.
When a switch is accessible for end users to make connections, for example, in a conference
room, an inexperienced or careless user (or saboteur) can bring down the network by
connecting two ports together, causing a loop. This can be prevented by using a hub, where a
loop will break other users on the hub, but not the rest of the network. (It can also be prevented
by buying switches that can detect and deal with loops, for example by implementing the
Spanning Tree Protocol.)
A hub with a 10BASE2 port can be used to connect devices that only support 10BASE2 to a
modern network. The same goes for linking in an old thicknet network segment using an AUI
port on a hub (individual devices that were intended for thicknet can be linked to modern
Ethernet by using an AUI-10BASE-T transceiver).
Switch
In networks, a device that filters and forwards packets between LAN segments. Switches
operate at the data link layer (layer 2) and sometimes the network layer (layer 3) of the OSI
Reference Model and therefore support any packet protocol. LANs that use switches to join
segments are called switched LANs or, in the case of Ethernet networks, switched Ethernet
LANs.
A network hub, or repeater, is a fairly unsophisticated network device. Hubs do not manage any
of the traffic that comes through them. Any packet entering a port is broadcast out or "repeated"
on every other port, except for the port of entry. Since every packet is repeated on every other
port, packet collisions result, which slows down the network.
There are specialized applications where a hub can be useful, such as copying traffic to multiple
network sensors. High end switches have a feature which does the same thing called port
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 20
mirroring. There is no longer any significant price difference between a hub and a low-end
switch.
Layer 2
A network bridge, operating at the Media Access Control (MAC) sublayer of the data link layer,
may interconnect a small number of devices in a home or office. This is a trivial case of bridging,
in which the bridge learns the MAC address of each connected device. Single bridges also can
provide extremely high performance in specialized applications such as storage area networks.
Once a bridge learns the topology through a spanning tree protocol, it forwards data link layer
frames using a layer 2 forwarding method. There are four forwarding methods a bridge can use,
of which the second through fourth method were performance-increasing methods when used
on "switch" products with the same input and output port speeds:
1. Store and forward: The switch buffers and, typically, performs a checksum on each frame
before forwarding it on.
2. Cut through: The switch reads only up to the frame's hardware address before starting to
forward it. There is no error checking with this method.
3. Fragment free: A method that attempts to retain the benefits of both "store and forward"
and "cut through". Fragment free checks the first 64 bytes of the frame, where addressing
information is stored. According to Ethernet specifications, collisions should be detected
during the first 64 bytes of the frame, so frames that are in error because of a collision will
not be forwarded. This way the frame will always reach its intended destination. Error
checking of the actual data in the packet is left for the end device in Layer 3 or Layer 4
(OSI), typically a router.
4. Adaptive switching: A method of automatically switching between the other three modes.
Cut-through switches have to fall back to store and forward if the outgoing port is busy at the
time the packet arrives. While there are specialized applications, such as storage area
networks, where the input and output interfaces are the same speed, this is rarely the case in
general LAN applications. In LANs, a switch used for end user access typically concentrates
lower speed (e.g., 10/100 Mbit/s) into a higher speed (at least 1 Gbit/s). Alternatively, a switch
that provides access to server ports usually connects to them at a much higher speed than is
used by end user devices.
Layer 3
Within the confines of the Ethernet physical layer, a layer 3 switch can perform some or all of
the functions normally performed by a router. A true router is able to forward traffic from one
type of network connection (e.g., T1, DSL) to another (e.g., Ethernet, WiFi).
The most common layer-3 capability is awareness of IP multicast. With this awareness, a layer-
3 switch can increase efficiency by delivering the traffic of a multicast group only to ports where
the attached device has signaled that it wants to listen to that group. If a switch is not aware of
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 21
multicasting and broadcasting, frames are also forwarded on all ports of each broadcast
domain, but in the case of IP multicast this causes inefficient use of bandwidth. To work around
this problem some switches implement IGMP snooping.
Layer 4
While the exact meaning of the term Layer-4 switch is vendor-dependent, it almost always starts
with a capability for network address translation, but then adds some type of load distribution
based on TCP sessions. The device may include a stateful firewall, a VPN concentrator, or be
an IPSec security gateway.
Layer 7
Layer 7 switches may distribute loads based on URL or by some installation-specific technique
to recognize application-level transactions. A Layer-7 switch may include a web cache and
participate in a content delivery network.
Fig.7.1 Router
Router
A device that forwards data packets along networks. A router is connected to at least two networks,
commonly two LANs or WANs or a LAN and its network. Routers are located at gateways, the places
where two or more networks connect.
Routers use headers and forwarding tables to determine the best path for forwarding the
packets, and they use protocols such as ICMP to communicate with each other and configure
the best route between any two hosts. Very little filtering of data is done through routers.
Types of routers
Routers may provide connectivity inside enterprises, between enterprises and the Internet, and
inside Internet Service Providers (ISPs). The largest routers (for example the Cisco CRS-1 or
Juniper T1600) interconnect ISPs, are used inside ISPs, or may be used in very large enterprise
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 22
networks. The smallest routers provide connectivity for small and home offices. Routers for
Internet connectivity and internal use
Routers intended for ISP and major enterprise connectivity will almost invariably exchange
routing information with the Border Gateway Protocol (BGP). RFC 4098 defines several types of
BGP-speaking routers:
Edge Router: Placed at the edge of an ISP network, it speaks external BGP (eBGP) to a
BGP speaker in another provider or large enterprise Autonomous System(AS).
Subscriber Edge Router: Located at the edge of the subscriber's network, it speaks eBGP
to its provider's AS(s). It belongs to an end user (enterprise) organization.
Inter-provider Border Router: Interconnecting ISPs, this is a BGP speaking router that
maintains BGP sessions with other BGP speaking routers in other providers' ASes.
Core router: A router that resides within the middle or backbone of the LAN network rather
than at its periphery.
Within an ISP: Internal to the provider's AS, such a router speaks internal BGP (iBGP) to that
provider's edge routers, other intra-provider core routers, or the provider's inter-provider border
routers.
"Internet backbone:" The Internet does not have a clearly identifiable backbone, as did its
predecessors. See default-free zone (DFZ). Nevertheless, it is the major ISPs' routers that make
up what many would consider the core. These ISPs operate all four types of the BGP-speaking
routers described here. In ISP usage, a "core" router is internal to an ISP, and used to
interconnect its edge and border routers. Core routers may also have specialized functions in
virtual private networks based on a combination of BGP and Multi-Protocol Label Switching
(MPLS). Routers are also used for port forwarding for private servers.
RJ45
The RJ45 is a modular connector used to terminate twisted pair and multiconductor flat
cable. It is not in common use, but RJ45 is used as the name for the 8P8C modular connector,
which is commonly used to terminate Ethernet cable.
Originally, there was only the true telephone RJ45. It is one of the many registered jacks, like
RJ11, a standard from which it gets the "RJ" in its name. As a registered jack, true telephone
RJ45 specifies both the physical connector and wiring pattern. The true telephone RJ45 uses a
special, keyed 8P2C modular connector, with Pins 5 and 4 wired for tip and ring of a single
telephone line and Pins 7 and 8 connected to a programming resistor. It is meant to be used
with a high speed modem, and is obsolete today.
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 23
D-LINK DE-824TP 24 PORT HUB (HUB A)
DE-816TP 16 PORT HUB (HUB B)
BACKBONE N/W
SWITCH
LAB SERVER 192.168.1.X BACKUP SERVER
192.168.11.15 192.168.11.14
GateWay
192.168.11.1
NETID
192.168.11.0
HUB-DLINK B
HUB-DLINK A 24PORT
24PORT
192.168.11.43 192.168.11.45
192.168.11.42 192.168.11.44
192.168.11.46
192.168.11.20 192.168.11.3 192.168.11.4 192.168.11.5 192.168.11.49 192.168.11.48 192.168.11.47
CONCLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 24
EXPERIMENT 8
NETWORK COMMANDS
OBJECTIVES:
(i) To test different network utilities like ping, tracert, arp, ipconfig
(ii) To study and use different options for these utilities
Ping
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:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 25
From 192.168.11.1 icmp_seq=3 Time to live exceeded
^C
--- 192.168.51.1 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2400ms
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 26
64 bytes from 192.168.51.1: icmp_seq=2 ttl=253 time=0.395 ms
64 bytes from 192.168.51.1: icmp_seq=3 ttl=253 time=0.404 ms
64 bytes from 192.168.51.1: icmp_seq=4 ttl=253 time=0.402 ms
64 bytes from 192.168.51.1: icmp_seq=5 ttl=253 time=0.407 ms
^C
--- 192.168.51.1 ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4315ms
rtt min/avg/max/mdev = 0.395/0.407/0.428/0.016 ms
Tracert / Tracepath
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:
Example:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 27
Tracing route to 192.168.1.100 over a maximum of 30 hops
Trace complete.
Ipconfig
The "ifconfig" command allows the operating system to setup network interfaces and allow the
user to view information about the configured network interfaces. In absence of arguments , it
displays the status of currently active interface. If a single interface argument is given it displays
the status of the given interface only.
PROCEDURE:
(1) First go to command prompt
(2) For help and information about this command type ipconfig /?
(3) Type ipconfig.
Example:
ARP
The Address Resolution Protocol (or ARP) is used to map the Internet Protocol address of a
machine to its Ethernet address. It simply uses a table which lists each host, its IP address and
its Ethernet address. You can view the the ARP table on your machine via the arp -a command
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 28
When a datagram is received addressed to an IP address on your network the router uses this
table to find the Ethernet address of the specified host and forwards the datagram appropriately.
Procedure
CONCLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 29
EXPERIMENT 9
OBJECTIVE:
(i) Understanding of packet capturing tool
Wireshark is a network packet analyzer. A network packet analyzer will try to capture network
packets and tries to display that packet data as detailed as possible.
PROCEDURE:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 30
(2) Goto Capture option
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 31
Stop capturing after some time.
CONCLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 32
EXPERIMENT 10
OBJECTIVES:
(i) Analysis of captured packets
(ii) Access the TCP and IP header using Wireshark
PROCEDURE :
Protocol Analysis
IP Header
Command : ping 192.168.11.16
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 33
TCP Header
Command : ftp 192.168.11.6
CONCLUSION :
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 34
EXPERIMENT - 11
OBJECTIVE:
(i) Investigate an applications of the Internet Control Message Protocol (ICMP)
PROCEDURE:
(1) Prepare Wireshark for a packet capture.
(2) Open a Command Prompt window. (In Linux , from menu the run command and type
konsole).
(3)
(4) Start Wireshark packet capture.
(5) Press ENTER in Command Prompt window. You should obtain a series of replies in
command prompt.
(6) Stop packet capture when Command Prompt returns.
(7) Save the contents in the Command Prompt window using a screen capture.
Protocol Analysis
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 35
2. IP Time-to-Live
Command : ping -t 1 192.168.51.1
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 36
Command : ping -t 3 192.168.51.1
CONCLUSION :
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 37
EXPERIMENT 12
PROCEDURE:
PROTOCOL ANALYSIS:
ttl=2
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 38
Fig.12.2 ttl =2
Reply Packet:
CONCLUSION:
Department of Electronics & Communication, Faculty of Technology, Dharmsinh Desai University, Nadiad 39