Ethernet Cables Can Be Wired As Straight Through or Crossover
Ethernet Cables Can Be Wired As Straight Through or Crossover
Week1: Study of different types of Network cables and Implement the cross-wired cable and
straight through cable and configure the Network Topology using Packet Tracer
Switch to switch
Switch to hub
Hub to hub
Router to router
Router Ethernet port to PC NIC
PC to PC
Conclusion:
At present, the straight through cable is much more popular than crossover cable and is widely used
by people. FS.COM provides a full range straight through Cat5e, Cat6, Cat6a and Cat7 Ethernet
cables with many lengths and colors options.
Rollover Wired Cables
A rollover cable is a network cable that connects a computer terminal to a network router’s
console port.
Ex. Cisco console cable
Rollover wired cables, most commonly called rollover cables, have opposite Pin assignments on
each end of the cable or, in other words,
Router Pin, Router Pin Name, Direction, Workstation Pin, Workstation Pin Name
1 – white-Orange, bi-directional, 8, brown
2 – orange, bi-directional, 7, white-brown
3 – white-green, bi-directional, 6, green
4 – blue, bi-directional, 5, white-blue
5 – white-blue, bi-directional, 4, blue
6 – green, bi-directional, 3, white-green
7 – white-brown, bi-directional, 2, orange
8 – brown, bi-directional, 1, white-orange
Reference :https://www.comparitech.com/net-admin/difference-between-straight-through-crossover-rollover-cables/
Configure the Network Topology using Packet Tracer:
Packet Tracer:
Packet Tracer is a cross-platform visual simulation tool designed by Cisco Systems that allows users to
create network topologies and imitate modern computer networks.
Packet Tracer makes use of a drag and drop user interface, allowing users to add and remove
simulated network devices as they see fit.
Packet Tracer can be run on Linux, Microsoft Windows, and macOS. Packet Tracer allows users to
create simulated network topologies by dragging and dropping routers, switches and various other types of
network devices. Packet Tracer supports an array of simulated Application Layer protocols, as well as basic
routing with RIP, OSPF, EIGRP, BGP.
Packet Tracer supports a multi-user system that enables multiple users to connect multiple
topologies together over a computer network.
Network Topology:
Topology defines the structure of the network of how all the components are interconnected to each
other.
A network topology is the physical and logical arrangement of nodes and connections in a network.
Nodes usually include devices such as switches, routers and software with switch and router.
Mesh Topology
Star Topology
Bus Topology
Ring Topology
Tree Topology
Hybrid Topology
Star Topology: Star topology is an arrangement of the network in which every node is connected to
the central hub, switch or a central computer.
Step 1: We have taken a switch and linked it to six end devices.
Step 2: Link every device with the switch.
Step 4: Transfer message from one device to another and check the Table for Validation.
Now to check whether the connections are correct or not try to ping any device
To do ping one terminal of one device and run the following command:
Command:
"ping ip_address_of _any_device"
Example: ping 192.168.1.4
Click on send..then click on simulation observe message is transferred from one device to another.
Mesh Topology
Hybrid Topology
Week 2: Implement the data link layer framing methods such as character stuffing and bit
stuffing.
#include<stdlib.h>
void main( )
char in[MAXSIZE];
char stuff[MAXSIZE];
char unstuff[MAXSIZE];
int count=0,j=0,i=0;
scanf("%s",in);
while(in[i]!='\0')
if(in[i]=='0')
stuff[j]=in[i];
i++;
j++;
else
count++;
stuff[j]=in[i];
i++;
j++;
if(count==5)
stuff[j]='0';
j++;
count=0;
stuff[j]='\0';
printf(“01111110”);
printf("\n%s",stuff);
printf(“01111110”);
i=0;
j=0;
while(stuff[i]!='\0')
if(stuff[i]=='0')
unstuff[j]=stuff[i];
i++;
j++;
else
count++;
unstuff[j]=stuff[i];
i++;
j++;
if(count==5)
i++;
count=0;
unstuff[j]='\0';
printf("\n%s\n",unstuff);
INPUT/OUTPUT:
10111111011
The stuffed character string is:
10111111011
// Charater Stuffing
#include<stdio.h>
//#include<conio.h>
#include<string.h>
//#include<process.h>
void main()
int i=0,j=0,n,pos;
char a[20],b[50],ch;
//clrscr();
printf("enter string\n");
scanf("%s",a);
n=strlen(a);
printf("enter position\n");
scanf("%d",&pos);
if(pos>n)
scanf("%d",&pos);
ch=getche();
b[0]='d';
b[1]='l';
b[2]='e';
b[3]='s';
b[4]='t';
b[5]='x';
j=6;
while(i<n)
if(i==pos-1)
b[j]='d';
b[j+1]='l';
b[j+2]='e';
b[j+3]=ch;
b[j+4]='d';
b[j+5]='l';
b[j+6]='e';
j=j+7;
b[j]='d';
b[j+1]='l';
b[j+2]='e';
j=j+3;
b[j]=a[i];
i++;
j++;
b[j]='d';
b[j+1]='l';
b[j+2]='e';
b[j+3]='e';
b[j+4]='t';
b[j+5]='x';
b[j+6]='\0';
printf("%s",b);
//getch();
Output:
enter string
doodle
enter position
week3:
#include <stdio.h>
#include <math.h>
int input[32];
int code[32];
int ham_calc(int,int);
void main()
{
int n,i,p_n = 0,c_l,j,k;
printf("Please enter the length of the Data Word: ");
scanf("%d",&n);
printf("Please enter the Data Word:\n");
for(i=0;i<n;i++)
{
scanf("%d",&input[i]);
}
i=0;
while(n>(int)pow(2,i)-(i+1))
{
p_n++;
i++;
}
c_l = p_n + n;
j=k=0;
for(i=0;i<c_l;i++)
{
if(i==((int)pow(2,k)-1))
{
code[i]=0;
k++;
}
else
{
code[i]=input[j];
j++;
}
}
for(i=0;i<p_n;i++)
{
int position = (int)pow(2,i);
int value = ham_calc(position,c_l);
code[position-1]=value;
}
printf("\nThe calculated Code Word is: ");
for(i=0;i<c_l;i++)
printf("%d",code[i]);
printf("\n");
printf("Please enter the received Code Word:\n");
for(i=0;i<c_l;i++)
scanf("%d",&code[i]);
int error_pos = 0;
for(i=0;i<p_n;i++)
{
int position = (int)pow(2,i);
int value = ham_calc(position,c_l);
if(value != 0)
error_pos+=position;
}
if(error_pos == 0)
printf("The received Code Word is correct.\n");
else
printf("Error at bit position: %d\n",error_pos);
}
int ham_calc(int position,int c_l)
{
int count=0,i,j;
i=position-1;
while(i<c_l)
{
for(j=i;j<i+position;j++)
{
if(code[j] == 1)
count++;
}
i=i+2*position;
}
if(count%2 == 0)
return 0;
else
return 1;
}
Please enter the length of the Data Word: 7
Please enter the Data Word:
1
0
1
1
0
1
1
Week 4: Implement on a data set of characters the three CRC polynomials – CRC 12, CRC and
CCIP.
//crc
#include <stdio.h>
#include <string.h>
void main()
{
int i,j,keylen,msglen;
char input[100], key[30],temp[30],quot[100],rem[30],key1[30];
printf("Enter Data: ");
scanf("%s",input);
printf("Enter Key: ");
scanf("%s",key);
keylen=strlen(key);
msglen=strlen(input);
strcpy(key1,key);
for (i=0;i<keylen-1;i++)
{
input[msglen+i]='0';
}
for (i=0;i<keylen;i++)
temp[i]=input[i];
for (i=0;i<msglen;i++)
{
quot[i]=temp[0];
if(quot[i]=='0')
for (j=0;j<keylen;j++)
key[j]='0';
else
for (j=0;j<keylen;j++)
key[j]=key1[j];
for (j=keylen-1;j>0;j--)
{
if(temp[j]==key[j])
rem[j-1]='0';
else
rem[j-1]='1';
}
rem[keylen-1]=input[i+keylen];
strcpy(temp,rem);
}
strcpy(rem,temp);
printf("\nQuotient is ");
for (i=0;i<msglen;i++)
printf("%c",quot[i]);
printf("\nRemainder is ");
for (i=0;i<keylen-1;i++)
printf("%c",rem[i]);
printf("\nFinal data is: ");
for (i=0;i<msglen;i++)
printf("%c",input[i]);
for (i=0;i<keylen-1;i++)
printf("%c",rem[i]);
}
Output:
Enter Data: 1010000
Enter Key: 1001
Quotient is 1011011
Remainder is 011
Final data is: 1010000011
Week5:
1. IPCONFIG
The IPConfig command also provides us with some variation in the primary command that targets specific system settings
or data, which are:
IPConfig/all - Provides primary output with additional information about network adapters.
2. NSLOOKUP
The NSLOOKUP command is used to troubleshoot network connectivity issues in the system. Using the nslookup
command, we can access the information related to our system’s DNS server, i.e., domain name and IP address.
3. HOSTNAME
The HOSTNAME command displays the hostname of the system. The hostname command is much easier to use than going into the system settings
to search for it.
4. PING
The Ping command is one of the most widely used commands in the prompt tool, as it allows the user to check the
connectivity of our system to another host.
This command sends four experimental packets to the destination host to check whether it receives them successfully, if so,
then, we can communicate with the destination host. But in case the packets have not been received, that means, no
communication can be established with the destination host.
5.TRACERT
The TRACERT command is used to trace the route during the transmission of the data packet over to the destination host and also provides us with
the “hop” count during transmission.
Using the number of hops and the hop IP address, we can troubleshoot network issues and identify the point of the problem during the transmission of
the data packet.
It is used for network statics, diagnostics, and analysis. If we are managing a huge college
campus network, then this tool is useful because it provides an advanced aspect of the
network.
8.Systeminfo
Using the SYSTEMINFO command, we can access the system’s hardware and software details, such as processor
data, booting data, Windows version, etc.
9.GETMAC
getmac (get mac address). This command returns the MAC address from all the network cards on a system. When troubleshooting a client
connection
Week5 Continuation
a) Classification of IP address
IPv4 address is 32 bits
Divide it into a “network part” and “host part”
o “network part” of the address identifies which network in the internetwork (e.g.
the Internet)
“host part” identifies host on that network
Configure IP address to Router and PC in Packet Tracer
As a Network Engineer, it is compulsory to know how to configure an IP Address on networking devices like Router, Switch, PC,
and Server.
Assigning an IP address to a device is a foundational requirement for all Cisco networking devices.
Networking devices communicate with each other with the help of IP address that configures on an individual device.
i) Configure an IP Address to PC
There are following steps involved to configure an IP Address to PC:
Step1: Open the Cisco Packet Tracer.
Step2: Drag and drop PC from the bottom of the interface into the middle of the working
area.
Step3: Click on PC ->Config Gateway like 10.0.0.1
ii) Configure an IP Address on Router’s Interface
There are two ways to configure an IP Address on the Router's Interface-
Step 6: Now configure an IP address and subnet mask then give “no shutdown” command. (In
our case, IP address is 10.0.0.2 and subnet mask is 255.0.0.0)
Note: Carefully configure IP address with proper interfaces.
Now, configure an IP address and subnet mask, and then give no shutdown command. (In our case IP address is 10.0.0.2 and
subnet mask is 255.0.0.0)
b) Subnetting:
Subnetting is the procedure to divide the network into sub-networks or small networks, these
smaller networks are known as subnets
Click the video and follow the steps
https://www.youtube.com/watch?v=7RG52YSFBrM
c) Supernetting:
Supernetting is the procedure to combine small networks into larger spaces. In subnetting,
Or It is the process of combining multiple subnetworks into one network. It's also known as
aggregation or route summarization
https://www.youtube.com/watch?v=PYmnFxErtm8
Week 6: Connect the computers in Local Area Network and Observing Static and Dynamic
Routing using Packet Tracer
Static routing is a routing protocol that helps to keep your network organized and to optimize routing performance. It enables the router to
assign a specific path to each network segment and to keep track of network changes. This helps to improve network stability and
continuity. This adds security because a single administrator can only authorize routing to particular networks.
Steps to Configure and Verify Two Router Connections in Cisco Packet Tracer :
Step 1: First, open the cisco packet tracer desktop and select the devices given below:
S.NO Device Model Name Qty.
1. PC PC 4
PT-
Switch 2
2. Switch
S.NO Device Model Name Qty.
3. Router PT-Router 2
IP Addressing Table For PCs:
NO Device IPv4 Address Subnet Mask Default Gateway
Step 2: Configure the PCs (hosts) with IPv4 address and Subnet Mask according to the IP addressing table given above.
To assign an IP address in PC0, click on PC0.
Then, go to desktop and then IP configuration and there you will IPv4 configuration.
Fill IPv4 address and subnet mask.
Step 3: Assigning IP address using the ipconfig command.
We can also assign an IP address with the help of a command.
Go to the command terminal of the PC.
Then, type ipconfig <IPv4 address><subnet mask><default gateway>(if needed)
Example: ipconfig 192.168.1.3 255.255.255.0 192.168.1.1
Repeat the same procedure with other PCs to configure them thoroughly.
Step 4: Configure router with IP address and subnet mask.
S.N
O Device Interface IPv4 Addressing Subnet Mask
1.
router0 FastEthernet0/ 192.168.1.1 255.255.255.0
0
S.N
O Device Interface IPv4 Addressing Subnet Mask
FastEthernet0/
192.168.2.1 255.255.255.0
router1 0
Dynamic Routing :
Dynamic routing is all about configuring a network using dynamic routing protocols.
After configuring these IP addresses to the corresponding devices only, we should configure
dynamic routing to the network.
When doing dynamic routing using RIP protocol first we should identify the networks which
are connected to each router and for those routers we have to connect those networks
through RIP.
So below mentioned procedure will guide you to do the RIP dynamic routing.
The below figure shows us the routing table which is updating periodically.
C- directly connected networks are marked as C.
R- networks which connected using the RIP dynamic routing
Below two figures are showing us the current running configurations of the router 1.
2. Router 2 configuration steps.
3. Router 3 configuration steps.
After Configuring three routers as above mentioned, we can now send packets through one end to another.
To check whether it is working we can check by ping command.
PING command can check the connection between two end devices and have to execute in the terminal of
the source device.
Now we will just get an example to demonstrate this scenario. So for that, we will take PC 1 as the SOURCE
DEVICE and PC 3 as the DESTINATION DEVICE.
PC 1 IP- 192.168.10.1
PC 3 IP- 192.168.20.1
Below figure we can see that the data packets transfer and the data packets which have lost their path.
Week 7: Implement Dijkstra‘s algorithm to compute the Shortest path through a graph.
for(i=0;i<n;i++)
for(j=0;j<n;j++)
scanf("%d",&G[i][j]);
return 0;
}
int cost[MAX][MAX],distance[MAX],pred[MAX];
int visited[MAX],count,mindistance,nextnode,i,j;
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:
1 a
2
b c
0
Enter the adjacency matrix:
012
100
200
Distance of node1=1
Path=1<-0
Distance of node2=2
Path=2←0
Week 8: Now obtain Routing table art each node using distance vector routing algorithm
struct node
{
unsigned dist[20];
unsigned from[20];
}rt[10];
int main()
{
int dmat[20][20];
int n,i,j,k,count=0;
printf("\nEnter the number of nodes : ");
scanf("%d",&n);
printf("\nEnter the cost matrix :\n");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
{
scanf("%d",&dmat[i][j]);
dmat[i][i]=0;
rt[i].dist[j]=dmat[i][j];
rt[i].from[j]=j;
}
do
{
count=0;
for(i=0;i<n;i++)
for(j=0;j<n;j++)
for(k=0;k<n;k++)
if(rt[i].dist[j]>dmat[i][k]+rt[k].dist[j])
{
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<n;i++)
{
printf("\n\nState value for router %d is \n",i+1);
for(j=0;j<n;j++)
{
printf("\t\nnode %d via %d Distance%d",j+1,rt[i].from[j]+1,rt[i].dist[j]);
}
}
printf("\n\n");
}
1 a
2
b c
OUTPUT: 0
Enter the number of nodes : 3
Week 9: Take an example subnet of hosts. Obtain broadcast tree for it.
//implement broad cast routing
#include<stdio.h>
#include<conio.h>
int a[10][10],n;
void main()
int i,j,root;
clrscr();
scanf("%d",&n);
for(i=1;i<=n;i++)
for(j=1;j<=n;j++)
scanf("%d",&a[i][j]);
scanf("%d",&root);
adj(root);
adj(int k)
int i,j;
printf("Adjacent node of root node::\n");
printf("%d\n",k);
for(j=1;j<=n;j++)
if(a[k][j]==1 || a[j][k]==1)
printf("%d\t",j);
printf("\n");
for(i=1;i<=n;i++)
printf("%d",i);
Week 10: Write a program for congestion control using leaky bucket algorithm.
#include<stdio.h>
#include<stdlib.h>
struct packet
int time;
int size;
}p[50];
int main()
int i,n,m,k=0;
int bsize,bfilled,outrate;
scanf("%d",&n);
scanf("%d%d",&p[i].time,&p[i].size);
scanf("%d",&bsize);
scanf("%d",&outrate);
m=p[n-1].time;
i=1;
k=0;
bfilled=0;
while(i<=m || bfilled!=0)
if(p[k].time==i )
if(bsize>=bfilled + p[k].size)
bfilled=bfilled + p[k].size;
k=k+1;
else
{
k=k+1;
if(bfilled==0)
else if(bfilled>=outrate)
bfilled=bfilled-outrate;
else
bfilled=0;
i++;
return 0;
OUTPUT:
Enter the number of packets: 3
At time 1
At time 2
At time 3
Introduction
Wireshark is a network packet analyzer. A network packet analyzer presents captured packet data in as much detail as possible
Wireshark is a free and open-source packet analyzer. It is used for network troubleshooting, analysis, software
and communications protocol development, and education.
Wireshark is cross-platform, using the Qt widget toolkit in current releases to implement its user interface, and using pcap to
capture packets; it runs on Linux, macOS, BSD, Solaris, some other Unix-like operating systems, and Microsoft Windows
Features:
Data can be captured "from the wire" from a live network connection or read from a file of already-captured
packets.
Live data can be read from different types of networks, including Ethernet, IEEE 802.11, PPP, and loopback.
Captured network data can be browsed via a GUI, or via the terminal (command line) version of the utility,
TShark.
Captured files can be programmatically edited or converted via command-line switches to the "editcap"
program.
Data display can be refined using a display filter.
Wireshark can color packets based on rules that match particular fields in packets, to help the
user identify the types of traffic at a glance. A default set of rules is provided; users can change
existing rules for coloring packets, add new rules, or remove rules.
Wireshark uses NMAP’s Packet Capture library(called npcap).
Getting Up and Running: After installation launch Wireshark, approve the administrator or superuser privileges and you will be presented
with a window that looks like this:
This window shows the interfaces on your device. To start sniffing select one interface and click on the bluefin icon
on the top left. The data capture screen has three panes. The top pane shows real-time traffic, the middle one
shows information about the chosen packet and the bottom pane shows the raw packet data. The top pane shows
source address(IPv4 or IPv6) destination address, source and destination ports, protocol to which the packet
belongs to and additional information about the packet.
As mentioned, Wireshark uses a color-coding system for data visualization. Each packet is marked with a different color
that represents different types of traffic. For example, TCP traffic is usually highlighted with blue, while black is used to
indicate packets containing errors.
Of course, you don’t have to memorize the meaning behind each color. Instead, you can check on the spot:
2. Select the “View” tab from the toolbar at the top of the screen.
You’ll see the option to customize the colorization to your liking. However, if you only want to change the coloring rules
temporarily, follow these steps:
Protocol
A protocol is a guideline that determines the data transmission between different devices that are connected to the same
network. Each Wireshark packet contains a protocol, and you can bring it up by using the display filter. Here’s how:
1. At the top of the Wireshark window, click on the “Filter” dialog box.
2. Enter the name of the protocol you want to examine. Typically, protocol titles are written in lowercase letters.
3. Click “Enter” or “Apply” to enable the display filter.
Length
The length of a Wireshark packet is determined by the number of bytes captured in that particular network snippet. That
number usually corresponds with the number of raw data bytes listed at the bottom of the Wireshark window.
If you want to examine the distribution of lengths, open the “Packet Lengths” window. All the info is divided into the
following columns:
Packet lengths
Count
Average
Min Val/Max Val
Rate
Percent
Burst rate
Burst start
Info
If there are any anomalies or similar items within a particular captured packet, Wireshark will note it. The information will
then be displayed in the packet list pane for further examination. That way, you’ll have a clear picture of atypical network
behavior, which will result in speedier reactions.
Filtering is an efficient feature that allows you to look into the specifics of a particular data sequence. There are two types
of Wireshark filters: capture and display. Capture filters are there to restrict the packet capture to fit specific demands. In
other words, you can sift through different types of traffic by applying a capture filter. As the name suggests, display filters
allow you to hone in on a particular element of the packet, from packet length to protocol.
Applying a filter is a pretty straightforward process. You can type the filter title in the dialog box at the top of the Wireshark
window. In addition, the software will usually auto-complete the name of the filter.
Analyzing Packets
Once the packets are captured, Wireshark organizes them in a detailed packet list pane
that’s incredibly easy to read. If you want to access the information regarding a single
packet, all you have to do is locate it on the list and click. You can also further expand
the tree to access the details of each protocol contained within the packet.
Open the “Analyze” tab in the toolbar at the top of the Wireshark window.
Browse through the list and click on the one you want to apply.
Finally, here are some common Wireshark filters that can come in handy:
• To only view the source and destination IP address, use: “ ip.src==IP-address and ip.dst==IP-address”
• To capture everything but the ARP and DNS traffic, use: “port not 53 and not arp”
Week11:
TCP Analysis
TCP Analysis flags are added to the TCP protocol tree under “SEQ/ACK analysis”
TCP Keep-Alive
Set when the segment size is zero or one, the current sequence number is one byte less than the next
expected sequence number, and none of SYN, FIN, or RST are set.
UDP:
Source port: The source port number of the packet. Example: 4444.
Destination port: The destination port number of packet. Example: 51164.
Length: The length of UDP Data + UDP header.
Checksum: Checksum is present to detect error. Unlike TCP, Checksum calculation is not mandatory in UDP. No Error control or
flow control is provided by UDP. Hence UDP depends on IP and ICMP for error reporting.
Applications:
Week12: Capture and Anlayze the Packets using Wire shark for the following Protocols
HTTP ,DNS
we can analyze DNS queries easily. We shall be following the below steps:
In the menu bar, Capture → Interfaces.
Select a particular Ethernet adapter and click start.
After this, browse to any web address and then return to Wireshark. Browsing would get packets captured and in Wireshark click the
stop in the Capture menu to stop the capture.
If you haven’t got the packet list by now, you can access it using Edit → Find Packets. This will give you the packet list.
Since we are going to analyze DNS we shall be studying only DNS packets and to get DNS packets, only you can apply DNS in the
filters above.
HTTP:
The Hyper Text Transport Protocol is a text-based request-response client-server protocol. A HTTP client (e.g. a web browser such as Mozilla)
performs a HTTP request to a HTTP server (e.g. the Apache HTTP server), which in return will issue a HTTP response. The HTTP protocol header
is text-based, where headers are written in text lines.
http
http.response.code == 404
Capture Filter
You cannot directly filter HTTP protocols while capturing. However, if you know the TCP port used (see above), you can filter on that one.
tcp port 80