Experiment 1: Fabrication of Cables
Experiment 1: Fabrication of Cables
Fabrication of Cables
Aim
1) To practice the colour code for different cables.
2) Observe the LAN Tester and make the decision accordingly.
Theory
A twisted pair consists of two insulated conductors twisted together in the shape of a spiral.
It can be shielded or unshielded. The unshielded twisted pair cables are very cheap and easy
to install. But they are very badly affected by the electromagnetic noise interference.
Twisting of wires will reduce the effect of noise or external interference. The induced emf
into the two wires due to interference tends to cancel each other due to twisting.
Number of twists per unit length will determine the quality of cable. More twists
means better quality.
There are 3 types of UTP cables:-
1) Straight-through cable
2) Cross-over cable
3) Roll-over cable
A. Straight-through cable
Straight-Through refers to cables that have the pin assignments on each end of the cable. In
other words Pin 1 connector A goes to Pin 1 on connector B, Pin 2 connector A goes to to
Pin 2 connector B ect. Straight-Through wired cables are most commonly used to connect a
host to client. When we talk about cat5e patch cables, the Straight-Through wired cat5e
patch cable is used to connect computers, printers and other network client devices to the
router, switch or hub (the host device in this instance).
B. Crossover cable
Crossover wired cables (commonly called crossover cables) are very much like Straight-
Through cables with the exception that TX and RX lines are crossed (they are at oposite
positions on either end of the cable. Using the 568-B standard as an example below you will
see that Pin 1 on connector A goes to Pin 3 on connector B. Pin 2 on connector A goes to Pin
6 on connector B ect. Crossover cables are most commonly used to connect two hosts
directly. Examples would be connecting a computer directly to another computer,
connecting a switch directly to another switch, or connecting a router to a
router.
Note: While in the past when connecting two host devices directly a crossover cable was
required. Now days most devices have auto sensing technology that detects the cable and
device and crosses pairs when needed.
C. Roll-over cable
Rollover wired cables most commonly called rollover cables, have opposite Pin assignments
on each end of the cable or in other words it is "rolled over". Pin 1 of connector A would be
connected to Pin 8 of connector B. Pin 2 of connector A would be connected to Pin 7 of
connector B and so on. Rollover cables, sometimes referred to as Yost cables are most
commonly used to connect to devices console port to make programming changes to the
device. Unlike crossover and straight-wired cables, rollover cables are not intended to carry
data but instead create an interface with the device.
Procedure
1) The aim is to Fabricate a UTP Cable.
2) To perform the experiment follow the below steps
3) A choice list would be give that which type of cable is to be fabricated
4) Select the choice out of the three choices given
5) Once a selection is done then the user have to make the cable read
2) y
6) In-order to do so select the color codes on both the sides i.e Switch port and PC port.
7) After assigning the color codes click on the Start button to observe that the cable made is
correct or not.
8) Based on the observations made select if cable made is correct or not.
EXPERIMENT 2
Peer to Peer Topology
Aim
1) To construct Peer to Peer Topology
Theory
The word physical network topology is used to explain the manner in which a network is
physically connected. Devices or nodes in a network get connected to each other via
communication links and all these links are related to each other in one way or the other.
The geometric representation of such a relationship of links and nodes is known as the
topology of that network.
These topologies can be classifies into two types:-
1. Peer to peer
2. Primary - Secondary
Peer to peer is the relationship where the devices share the link equally. The examples are
ring and mesh topologies.
In Primary - Secondary relationship, one device controls and the other devices have to
transmit through it. For example star and tree topology.
Procedure
1) The aim is to Create the topology.
3)A blank square area would be given which defines the working area
5)In order to build a topology first select on the component and then immediately click on
the working area to place it
6)To draw a line between two components first select the line click on the port of first
component and then immediately click on the port of second component
7)Once the topology is build then click on the Submit button to test whether the give
topology is built correctly or not.
EXPERIMENT 3
Installation of NIC Card & using TCP/IP
Aim: Install and configure network adapters by doing the following:
(Network adapters are hardware devices, such as network interface cards, that are used
to communicateon networks)
Procedure :
• Configure the network adapter card following the manufacturer's instructions. For
example, we may need to set jumpers on the adapter board.
• Disconnect the computer and unplug it, then install the adapter board into the
appropriate slot on the computer. When we're finished, boot the system.
• Tell Windows NT about the new network adapter card by means of the Network Control
Panel utility. Start the utility by double-clicking on the Network icon in the Control Panel
Select the Adapters tab to display the dialog box shown in Figure. The fields of this tab
areused as follows:
Figure: The Adapter Properties dialog box lets us change the adapter's basic settings and
test it. Thetest only works if we have installed the TCP/IP protocol service.
• If the new network adapter isn't shown in the Network Adapters list box, click on the
Add button.
• Using the Select Network Adapter dialog box, select the appropriate network adapter.
Ifwe don't see the adapter we installed, click on the Have Disk button and insert the
adapter's installation disk when prompted.
Note: Adding the adapter also installs the drivers for the adapter. Because of this, be sure
that you usethe correct installation disk.
• The dialog boxwe see next depends on the type of adapter we're installing. With most
network interface cards, we see the Adapter Properties dialog box shown in Figure.
• Click on the Change button, then configure the adapter's basic settings, such as network
speed and duplex mode. If we've already configured the TCP/IP protocol service and the
computer is attached to the network, you can use the Test button to test the network
card. Click OK to continue.
• Close the Network properties dialog box by clicking on the Close button. Windows NT
installs the network bindings for the network adapter. Afterward, if TCP/IP is installed on
the computer, we'll see the Microsoft TCP/IP Properties dialog box. We use this dialog
box to configure the TCP/IP protocol service as detailed in the section of this chapter
titled "Configuring TCP/IP Networking."
EXPERIMENT 4
Computer networking professionals getting started with Packet Tracer may find the
interface to be flustered. Being a development program, this is only natural. However,
learning how to configure a router with Packet Tracer will put professionals on the right
track to mastering the program in about half an hour.
By this time, you should already have the Packet Tracer download and have it installed on
your computer. Open the program and select the router from the lower left-hand corner,
and drag it into the center of the sandbox screen as seen below. (Click for larger picture)
We will be setting up a very basic network that allows two computers to communicate, so
the next step is to select end devices from the bottom left-hand corner and drag it to the
sandbox screen. Do this twice to make two computers appear below the router.
Now select connections from the same bottom left-hand corner. When you connect like-
devices(Such as a router and computer) you use a crossover cable, so you should select
copper cross-over cable from the second menu to the immediate right. Click on Router0,
and connect the cable via FastEthernet0/0 as seen below:
Now click the PC0 and select FastEthernet. You will notice that although a link is established,
it is not functional. You can tell by the red dots that are present on both ends of the
connection. Once the router is configured correctly, the red dots will turn green to indicate
the devices are able to communicate.
Do the same operation to PC1, only this time connect the cable to FastEthernet0/1 since
FastEthernet0/0 is already taken by PC0. Your network should be similar to the one below at
this point:
Configuring The Router In Packet Tracer
A router that is turned off doesn’t work very well! Click on your router to bring up the
configuration menu and verify that it is turned on.When on, there will be a small green light
below the switch as seen in the diagram.
Next we have to open the Ethernet ports to allow communication. Although they are
physically connected, they are in a state that is known as being in administrative shut
down. Now click on the CLI tab to access the configuration menu. If you’ve used the Cisco
IOS before, you will notice it looks and acts the same way.
2. Type enable to get to privileged mode (this gives you more options in configuring the
router)
3. Type config terminal (or config t for short) to access the configuration menu.
That’s it! You should now see a message similar to the following:
Now we have to do the same thing for fastethernet0/1. If you don’t, there still won’t be a
connection to PC1! Make sure to enter the IP address carefully as seen below:
3. Type no shutdown
At this point our router is configured properly. If you test out a ping, you will notice that the
computers still don’t communicate, however!
Our last step is to configure the gateway on each desktop computer. The gateway is the
address we assigned to the Ethernet port that the desktop is connected to. It will allow the
computer to interface with another network, so our ping won’t work without it!
Click on PC0 to bring up the configuration menu. Under global settings you will find a field
for the gateway. Enter the corresponding IP address of the router’s interface, which is
192.168.10.1. Then click the FastEthernet tab on the left column to set the actual
computer’s IP address to be on the network. Use 192.168.10.2 for the IP address, and
255.255.255.0 for the subnet mask.
Do the same thing for PC1, only use 192.168.20.1 for the gateway address, 192.168.20.2 for
the IP address, and 255.255.255.0 for the subnet mask. You can confirm that your network
works by sending out a packet of information from PC0 to PC1, and vice versa. Click the
packet icon on the right menu as seen below:
Click on PC0 and then click PC1. On the lower right of the screen you will see a message box
that says “Successful.” If it doesn’t, you may have had a syntax error when putting in an IP
address or router configuration command. Review your work or ask for help among the
community if you are stuck.
Closing Comments
Congratulations! You have a small working network. A real-world application of this very
network would be to have two computers connected to the Internet, whereas the router
would then be connected to your telecommunications company. (Or what we would call the
“cloud”)
More advanced devices and topologies won’t be so easy, but you’re now on the right path
to becoming qualified for the CCNA certification exam.
EXPERIMENT 5
BIT STUFFING AND DESTUFFING
AIM: Implement the data link layer framing methods such as bit stuffing and destuffing.
PROGRAM:
#include<stdio.h>
#include<string.h>
void main()
{
//decaring the three string arrays for storing the input frame(in str1) ,stuffed frame(in str2)
and destuffed frame(in str3)
char str1[20],str2[20],str3[20],ch;
int i,j=0,m,n,c=0; //initializing the count value as zero
printf("Enter Input Frame:(0's & 1's only)\n");
scanf("%s",str1);
n=strlen(str1); //calculating the input string size.
for(i=0;i<n;i++)
{
ch=str1[i]; //copying the each character into ch variable
str2[j++]=ch; //copy each character into string2 which consists stuffed
string.
m=ch-48; //48 is the ascii equalent value of ‘0’.
//Converting the character value(ch) into interger value by subtracting 48
form ch.
if(m==1)//comparing the character with ‘1’
c++; //if character is ‘1’ then incrementing the count value
else
c=0;//if the character is not a ‘1’. Then count should be zero.
if(c==5)
//if count value equals to 5
{
str2[j++]='0';
c=0;//After five consecutive 1’s adding the ‘0’ to string2
}
}
ch=str2[i];
str3[j++]=ch;
m=ch-48;
if(m==1)
c++;
else
c=0;
if(c==5)
{
c=0;
EXPERIMENT 7
CRC
AIM: Implement on a data set of characters the three CRC polynomials – CRC 12, CRC 16 and
CRC CCIP .
PROGRAM:
#include<stdio.h>
void main()
{
int f[150],g[150],r[150],t[150],i,j,k,m,n,c=0;
printf("\nEnter frame size: ");
scanf("%d",&n);
printf("\nEnter frame(dividend): ");
for(i=0;i<n;i++)
{
scanf("%d",&f[i]);
t[i]=f[i];
}
printf("\nEnter divisor size: ");
scanf("%d",&m);
printf("\nEnter g(divisor): ");
for(i=0;i<m;i++)
{
scanf("%d",&g[i]);
}
for(i=n;i<n+m;i++)
t[i]=0;
for(i=0;i<n;i++)
{
k=i;
if(t[i]==1)
{
for(j=0;j<m;j++,k++)
{
if(t[k]==g[j])
t[k]=0;
else
t[k]=1;
}
}
}
printf("\nCheck sum is : ");
for(i=n;i<m+n-1;i++)
{
printf(" %d ",t[i]);
f[i]=t[i];
}
printf("\n\nCodeword : ");
for(i=0;i<m+n-1;i++)
printf(" %d ",f[i]);
printf("\n\nEnter received data : \n");
for(i=0;i<m+n-1;i++)
scanf("%d",&r[i]);
for(i=0;i<n;i++)
{
k=i;
if(r[i]==1)
{
for(j=0;j<m;j++,k++)
{
if(r[k]==g[j])
r[k]=0;
else
r[k]=1;
}
}
}
for(i=n;i<m+n-1;i++)
{
printf("%d",r[i]);
if(r[i]!=0)
c=1;
}
if(c==1)
printf("\nError ");
else
printf("\nNO error");
}
OUTPUT:
CRC – 4
Enter frame size: 4
Enter frame(dividend): 1 1 1 0
Enter divisor size: 5
Enter g(divisor): 1 0 0 1 1
Check sum is : 0 0 0 1
Codeword : 1 1 1 0 0 0 0 1
Enter received data :
11100001
0000
NO error
CRC-8
Enter frame size: 4
Enter frame(dividend): 1 1 1 0
Enter divisor size: 9
Enter g(divisor): 1 0 1 0 0 0 1 0 1
Check sum is : 0 1 1 1 1 0 0 1
Codeword : 1 1 1 0 0 1 1 1 1 0 0 1
Enter received data :
111001111001
00000000
NO error
CRC-12
Enter frame size: 4
Enter frame(dividend): 1 1 1 0
Enter divisor size: 13
Enter g(divisor): 1 1 1 1 0 0 1 0 1 0 1 0 0
Check sum is : 1 1 0 0 1 1 1 1 0 1 0 0
Codeword : 1 1 1 0 1 1 0 0 1 1 1 1 0 1 0 0
Enter received data :
1110110011110100
000000000000
NO error
EXPERIMENT 8
DVR(DISTANCE VECTOR ROUTING)
AIM: Take an example subnet graph with weights indicating delay between nodes. Now
obtain Routing table art each node using distance vector routing algorithm
PROGRAM:
#include<stdio.h>
struct node
{
unsigned dist[20];
unsigned from[20];
}rt[10];
int main()
{
int costmat[20][20];
int nodes,i,j,k,count=0;
printf("\nEnter the number of nodes : ");
scanf("%d",&nodes);//Enter the nodes
printf("\nEnter the cost matrix :\n");
for(i=0;i<nodes;i++)
{
for(j=0;j<nodes;j++)
{
scanf("%d",&costmat[i][j]);
costmat[i][i]=0;
rt[i].dist[j]=costmat[i][j];//initialise the distance equal to cost matrix
rt[i].from[j]=j;
}
}
do
{
count=0;
for(i=0;i<nodes;i++)//We choose arbitary vertex k and we calculate the direct
distance from the node i to k using the cost matrix
//and add the distance from k to node j
for(j=0;j<nodes;j++)
for(k=0;k<nodes;k++)
if(rt[i].dist[j]>costmat[i][k]+rt[k].dist[j])
{//We calculate the minimum distance
rt[i].dist[j]=rt[i].dist[k]+rt[k].dist[j];
rt[i].from[j]=k;
count++;
}
}while(count!=0);
for(i=0;i<nodes;i++)
{
printf("\n\n For router %d\n",i+1);
for(j=0;j<nodes;j++)
{
printf("\t\nnode %d via %d Distance %d ",j+1,rt[i].from[j]+1,rt[i].dist[j]);
}
}
printf("\n\n");
getch();
}
OUTPUT:
Enter the number of nodes :
3
Enter the cost matrix :
027
201
710
For router 1
node 1 via 1 Distance 0
node 2 via 2 Distance 2
node 3 via 3 Distance 3
For router 2
node 1 via 1 Distance 2
node 2 via 2 Distance 0
node 3 via 3 Distance 1
For router 3
node 1 via 1 Distance 3
node 2 via 2 Distance 1
node 3 via 3 Distance 0
EXPERIMENT 9
SHORTEST PATH
AIM: Implement Dijkstra‘s algorithm to compute the Shortest path thru a graph.
PROGRAM:
#include<stdio.h>
#include<conio.h>
#define INFINITY 9999
#define MAX 10
int main()
{
int G[MAX][MAX],i,j,n,u;
printf("Enter no. of vertices:");
scanf("%d",&n);
printf("\nEnter the adjacency matrix:\n");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
scanf("%d",&G[i][j]);
return 0;
}
distance[startnode]=0;
visited[startnode]=1;
count=1;
while(count<n-1)
{
mindistance=INFINITY;
//nextnode gives the node at minimum distance
for(i=0;i<n;i++)
if(distance[i]<mindistance&&!visited[i])
{
mindistance=distance[i];
nextnode=i;
}
j=i;
do
{
j=pred[j];
printf("<-%d",j);
}while(j!=startnode);
}
}
OUTPUT:
Enter no. of vertices:5
Enter the adjacency matrix:
0 10 0 30 100
10 0 50 0 0
0 50 0 20 10
30 0 20 0 60
100 0 10 60 0
Enter the starting node:0
Distance of node1=10
Path=1<-0
Distance of node2=50
Path=2<-3<-0
Distance of node3=30
Path=3<-0
Distance of node4=60
Path=4<-2<-3<-0
EXPERIMENT 10
BROADCAST ROUTING
AIM: Take an example subnet of hosts. Obtain broadcast tree for it.
PROGRAM:
#include<stdio.h>
int max( );
int distance[20];
int n;
main( )
{
int adj[20][20],adj1[20][20],flag[30];
int i,j,root,x;
int source,count=1,y=0;
printf(“Enter no.of nodes”);
scanf(“%d”,&n);
for(i=0;i<n;i++)
{
for(j=0;j<n;j++)
scanf(“%d”,&adj[i][j]);
}
printf(“Enter the source of broadcasting”);
scanf(“%d”,&source);
for(i=0;i<n;i++)
{
flag[i]=0;
}
for(root=0;root<n;root++)
{
for(i=0;i<n;i++)
distance[i]=adj[root][i];
x=min();
for(i=0;i<n;i++)
{
if(distance[i]= =x)
{
adj1[root][i]=x;
adj1[i][root]=x;
}
else
adj1[root][i]=0;
}
}
2 0
Enter the source for broadcasting 1
0 2
2 0
Minimal spanning tree is
0 2
2 0