0% found this document useful (0 votes)
46 views25 pages

CN Practical File

Uploaded by

singhshwetank891
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views25 pages

CN Practical File

Uploaded by

singhshwetank891
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 25

PRACTICAL 1

Implementation of Straight Through Cable

Objective: Creating Straight LAN Cable.

Requirement:
RJ-45 connector, Clipping Tool, Twisted pair Cable

Theory:
Introduction:
Straight through cables, also known as patch cables, are network cables used to connect different
types of devices. These cables have identical wiring on both ends, meaning each pin on one end of
the cable connects to the corresponding pin on the other end. This type of wiring configuration is
typically used for connecting:
1. Computers to network switches
2. Computers to hubs
3. Network switches to routers
4. Other devices that are different types (e.g., a computer to a printer with a network interface)

Straight through cables are most commonly used in local area networks (LANs) to connect devices
within the same network. They ensure that data is transmitted correctly between devices by aligning
the transmit and receive signals properly. The standard wiring for a straight through cable is usually
based on the T568A or T568B standards.

Procedure:
To do these practical following steps should be done:

1. Start by stripping off about 2 inches of the plastic jacket off the end of the cable. Be very careful at
this point, as to not nick or cut into the wires, which are inside. Doing so could alter the
characteristics of your cable, or even worse render is useless. Check the wires, one more time for
nicks or cuts. If there are any, just whack the whole end off, and start over.

2. Spread the wires apart but be sure to hold onto the base of the jacket with your other hand. You do
not want the wires to become untwisted down inside the jacket. Category 5 cable must only have
1/2 of an inch of 'untwisted' wire at the end; otherwise, it will be 'out of spec'. At this point, you
obviously have ALOT more than 1/2 of an inch of un-twisted wire.

3. You have 2 end jacks, which must be installed on your cable. If you are using a pre-made cable,
with one of the ends whacked off, you only have one end to install - the crossed over end. Below
are two diagrams, which show how you need to arrange the cables for each type of cable end.
Decide at this point which end you are making and examine the associated picture below.

Application:
Straight through cables are commonly used in networking to connect different types of devices.
Here are some specific applications:
1. Connecting Computers to Network Switches:
Used to link computers to switches in a local area network (LAN), enabling multiple
devices to communicate within the same network.
2. Connecting Computers to Hubs:
Employed to connect computers to hubs, allowing multiple devices to share a single
network segment.
3. Connecting Network Switches to Routers:
Utilized to connect switches to routers, facilitating the routing of data between different
networks and enabling internet connectivity.
4. Connecting Network Printers to Switches:
Used to connect network printers to switches, allowing multiple computers on the
network to send print jobs to the printer.
5. Connecting Modems to Routers:
Employed to connect modems to routers, enabling internet access for all devices
connected to the router.
6. Connecting Patch Panels to Switches:
Used in structured cabling systems to connect patch panels to switches, providing
organized and efficient cable management in network setups.
7. Connecting Workstations to Wall Outlets:
Employed to connect computers or other devices to network wall outlets, which are
connected to the network infrastructure.

These cables are essential for ensuring proper data transmission and communication between
network devices, maintaining network efficiency and reliability.

Result: Study and demonstration of Straight Through Cable is completed.


PRACTICAL 2
Implementation of Crossover Cable.

Objective: Creating Cross LAN Cable.

Requirement:
RJ-45 connector, Clipping Tool, Twisted pair Cable.

Theory:
Introduction:
A crossover cable is a type of Ethernet cable used to connect two similar devices directly,
without the need for a network switch or hub. Unlike a straight through cable, which has
identical wiring on both ends, a crossover cable has different wiring at each end. Specifically,
the transmit and receive pairs are crossed over, which allows the devices to communicate
directly with each other. This is achieved by wiring one end according to the T568A standard
and the other end according to the T568B standard.

Crossover cables are typically used for:

1. Connecting two computers directly: This allows them to communicate and share data
without a switch or router.

2. Connecting two switches or hubs directly: When connecting network infrastructure devices
without using an uplink port.

3. Connecting two similar network devices: Such as connecting two routers, two network
switches, or two hubs.

The key difference in wiring between the T568A and T568B standards lies in the arrangement
of the transmit (Tx) and receive (Rx) pairs, ensuring proper alignment for direct device-to-
device communication.

Procedure:
To do these practical following steps should be done:

1. Measure and Cut the Cable:


Measure the desired length of the cable and cut it using a wire cutter. Leave a bit of
extra length to allow for any mistakes.

2. Strip the Cable:


Use a wire stripper to remove about 1 inch (2.5 cm) of the outer jacket from each end of
the cable, exposing the twisted pairs inside.

3. Separate and Untwist the Pairs:


Carefully untwist the pairs of wires. There should be four pairs, each consisting of a
solid colour wire and a striped wire:
• Orange/white and orange
• Green/white and green
• Blue/white and blue
• Brown/white and brown
4. Arrange the Wires:
For a crossover cable, wire one end according to the T568A standard and the other end
according to the T568B standard.

5. Arrange the Wires (T568A):


Arrange the wires in the following order for one end:
• Green/white
• Green
• Orange/white
• Blue
• Blue/white
• Orange
• Brown/white
• Brown

6. Trim the Wires:


Hold the wires flat between your thumb and forefinger and trim them evenly, leaving about 0.5
inch (1.3 cm) exposed.

7. Insert the Wires into the RJ45 Connector:


Carefully insert the wires into the RJ45 connector, ensuring each wire goes into its
correct slot. The connector should be oriented with the clip facing down.

8. Arrange the Wires (T568B):


Arrange the wires in the following order for the other end:
• Orange/white
• Orange
• Green/white
• Blue
• Blue/white
• Green
• Brown/white
• Brown

9. Trim the Wires:


Hold the wires flat between your thumb and forefinger and trim them evenly, leaving about 0.5 inch
(1.3 cm) exposed.

10. Insert the Wires into the RJ45 Connector:


Carefully insert the wires into the RJ45 connector, ensuring each wire goes into its correct
slot. The connector should be oriented with the clip facing down.

11. Crimp the Connectors:


Place each RJ45 connector with the inserted wires into the crimping tool and firmly squeeze the
handle to secure the wires inside the connector. Ensure the wires are fully seated and the connectors
are properly crimped.

12. Test the Cable:


Use a cable tester to check the connectivity of the cable. The tester will confirm that each wire is
correctly connected and that the cable functions properly.
Application:
Crossover LAN cables are used in specific networking scenarios where direct device-to-device
communication is required without the use of network switches or hubs. Here are some
common applications:

1. Direct Computer-to-Computer Connections:


Crossover cables can directly connect two computers, allowing them to share files and
resources without needing a switch or hub. This is useful for small data transfers or
temporary networking setups.

2. Connecting Similar Network Devices:


When connecting two similar devices such as switches, hubs, or routers, a crossover
cable ensures proper communication. This is particularly useful in expanding network
infrastructure without needing a crossover switch port.

3. Network Equipment Configuration:


For configuring or troubleshooting network devices such as routers or switches, a
crossover cable can be used to connect a computer directly to the device. This direct
connection can simplify the configuration process.

4. Gaming Consoles and LAN Parties:


Crossover cables can be used to connect gaming consoles directly to each other for
multiplayer gaming without an internet connection. They are also useful in LAN parties
where direct connections between computers are required.

5. Temporary Networking:
In situations where a temporary network setup is needed, such as in a testing
environment or during equipment setup, crossover cables provide a quick and efficient
solution for direct device connections.

6. Old Network Equipment:


Older network devices that do not support Auto-MDI/MDIX (automatic crossover
detection and correction) may still require crossover cables for direct connections.

While modern network devices often have Auto-MDI/MDIX capabilities that allow the use of
either straight through or crossover cables, understanding the applications of crossover cables
remains valuable for specific networking scenarios and legacy equipment.

Result: Study and demonstration of Crossover LAN Cable is completed.


PRACTICAL 3
Implementation of Connectivity using PING Command

Objective: CREATE A NETWORK OF TWO COMPUTERS SAY A AND B, CHECK


CONNECTIVITY BETWEEN THEM WITH THE HELP OF PING COMMAND.

Requirement
Command Prompt and Packet Tracer.

Theory:
Introduction:
The ping command is a network utility used to test the reachability of a host on an Internet
Protocol (IP) network and to measure the round-trip time for messages sent from the originating
host to a destination computer. It is one of the most basic and widely used diagnostic tools in
networking.

Procedure:
Set up the Packet Tracer Environment

1. Open Cisco Packet Tracer:


• Launch Cisco Packet Tracer on your computer.

2. Create a New Workspace:


• Create a new workspace by selecting File > New.
• Add Devices to the Workspace

3. Add Two PCs:


• From the device type list, select the "End Devices" category.
• Drag and drop two PC devices onto the workspace. These will represent
Computer A and Computer B.
4. Add a Crossover Cable:
• From the device type list, select the "Connections" category.
• Choose the Crossover cable (usually represented by a broken line) and connect it
from the Ethernet port of PC0 (Computer A) to the Ethernet port of PC1
(Computer B).
• Configure IP Addresses
5. Configure IP Address for Computer A (PC0):
• Click on PC0.
• Go to the Desktop tab and open the IP Configuration tool.
• Set the IP address to 192.168.1.1 and the subnet mask to
255.255.255.0.
6. Configure IP Address for Computer B (PC1):
• Click on PC1.
• Go to the Desktop tab and open the IP Configuration tool.
• Set the IP address to 192.168.1.2 and the subnet mask to
255.255.255.0.
Check Connectivity with the Ping Command
7. Ping from Computer A to Computer
B:
• Click on PC0 (Computer A).
• Go to the Desktop tab and open the Command Prompt.
• Type ping 192.168.1.2 and press Enter.
• Observe the response. Successful replies indicate connectivity.

8. Ping from Computer B to Computer A:


• Click on PC1 (Computer B).
• Go to the Desktop tab and open the Command Prompt.
• Type ping 192.168.1.1 and press Enter.
• Observe the response. Successful replies indicate connectivity.

Analyse the Results

9. Interpret the Ping Results:


• If the ping command returns replies from the target IP address, it indicates that
the two computers are successfully connected and can communicate with each
other.
• If there are no replies, double-check the IP address configuration, cable
connections, and ensure that both computers are powered on in the simulation.

Troubleshooting Tips
10. No Response to Ping:
• Verify that the IP addresses are correctly assigned and within the same subnet.
• Ensure that the crossover cable is properly connected in the simulation.
• Check for any simulation errors or warnings in Packet Tracer.
11. Link Lights:
• In the simulation, ensure that the link lights on the Ethernet ports of both PCs are
green, indicating an active connection.

Result:
By following these steps, you have successfully created a network of two computers using Cisco Packet
Tracer and verified their connectivity using the ping command. This exercise is useful for understanding
basic network configurations and troubleshooting in a simulated environment.
PRACTICAL 4
Implementation of Network Commands and Their Outputs

Objective: EXECUTE THE FOLLOWING NETWORK ORIENTED COMMANDS [WITH ALL THEIR OPTIONS] AND
OBSERVE THEIR OUTPUT:

PING
TRACERT
ROUTE
IPCONFIG
ARP
NETSTAT
NBTSTAT
HOSTNAME

Requirement
Command Prompt and Packet Tracer.

Theory:
Introduction:
In the realm of computer networking, understanding and mastering various commands is
essential for troubleshooting, diagnostics, and maintaining network health. This chapter explores
fundamental network-oriented commands, detailing their options and typical outputs.

1. Ping
Command: ping

Function: Used to test connectivity between two nodes (usually a computer and a server) over
an IP network.

Options:

• -t: Continuously ping the target until manually stopped.


• -n count: Send a specified number of echo requests.
• -l size: Send a specific number of bytes in the ping packet.

Output Example:
python
Copy code
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time<1ms TTL=64

2.Tracert (Traceroute)

Command: tracert or traceroute

Function: Displays the route taken by packets across an IP network.

Options:
• -d: Do not resolve addresses to hostnames.
• -h max_hops: Maximum number of hops to search for target.

Output Example:

css
Copy code
Tracing route to google.com [172.217.167.110]
over a maximum of 30 hops:
1 1 ms 1 ms 1 ms 192.168.1.1
2 8 ms 8 ms 7 ms 10.10.10.1
1. 9 ms 9 ms 9 ms 68.85.189.1

3.Route

Command: route

Function: Shows and manipulates the IP routing table.

Options:

• -p: Persistent route.


• -4 or -6: Specifies IPv4 or IPv6 route information.

Output Example:

sql
Copy code
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.1.1 0.0.0.0 UG 100 0 0 eth0

4.Ipconfig (Windows) / ifconfig (Linux)

Command: ipconfig (Windows) / ifconfig (Linux)

Function: Displays IP configuration information for network interfaces.

Options:

• /all: Displays detailed configuration information.


• /release, /renew: Release or renew DHCP configuration.

Output Example:

yaml
Copy code
Ethernet adapter Local Area Connection:
Connection-specific DNS Suffix . :
IPv4 Address. . . . . . . . . . . : 192.168.1.100
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : 192.168.1.1

5.ARP (Address Resolution Protocol)

Command: arp

Function: Displays and modifies the ARP cache, which contains IP-to-MAC address mappings.

Options:

• -a: Displays the ARP table.

Output Example:

sql
Copy code
Interface: 192.168.1.100 --- 0x2
Internet Address Physical Address Type
192.168.1.1 00-1a-2b-3c-4d-5e dynamic

6.Netstat

Command: netstat

Function: Displays network connections, routing tables, interface statistics, masquerade


connections, and multicast memberships.

Options: • -a: Displays all connections and

listening ports.

• -r: Displays the routing table.

Output Example:

Copy code
Active Connections
Proto Local Address Foreign Address State
TCP 192.168.1.100:12345 203.0.113.5:80 ESTABLISHED

7.Nbtstat (Windows)

Command: nbtstat

Function: Displays NetBIOS over TCP/IP (NetBT) protocol statistics, NetBIOS name tables
for both local and remote computers, and the NetBIOS name cache.

Options:
• -a: Lists the NetBIOS name table of a remote computer.

Output Example:
sql
Copy code
NetBIOS Remote Machine Name Table
Name Type Status
---------------------------------------------
REMOTEHOST <00> UNIQUE Registered
WORKGROUP <00> GROUP Registered

8.Hostname

Command: hostname

Function: Displays the name of the current DNS domain and the names of the computers in the
specified domain.

Options: None commonly used.

Output Example:

Copy code
mycomputer.example.com

Result:
Each of these commands plays a crucial role in managing and troubleshooting networks,
providing administrators and users with invaluable insights into network connectivity,
configuration, and diagnostics. Mastery of these tools empowers efficient network management
and ensures smooth operation of interconnected systems.
PRACTICAL 5

Implementation of Building a Star Topology Network and Testing


Connectivity
Objective:
CREATE A NETWORK USING STAR TOPOLOGY OF N NODES CHECK BY PING
COMMAND WHETHER THEY ARE CONNECTED OR NOT.

Requirement

Command Prompt and Packet Tracer.

Theory:

Introduction:

A star topology for a Local Area Network (LAN) is one in which each node is connected to a
central connection point, such as a hub or switch. Whenever a node tries to connect with another
node then the transmission of the message must be happening with the help of the central node.
The best part of star topology is the addition and removal of the node in the network but too
many nodes can cause suffering to the network.

In this article, we will discuss How to Implement Star Topology using Cisco Packet Tracer.

A Cisco packet tracer is a simulation tool that is used for understanding the networks. The best
part of the Cisco packet tracer is its visualization you can see the actual flow of the message and
understand the workflow of the network devices. Implementation of Star Topology using Cisco
Packet Tracer is done using Switch.

Now to check whether the connections are correct or not try to ping any device and the image
below is doing the same.
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

Note:If the connections are correct


then you will receive the response.

Result:
In this chapter, we covered the steps to create a star topology network with NNN nodes using
Cisco Packet Tracer and verify their connectivity using the ping command. By following this
guide, you should be able to set up a star network efficiently in a virtual environment and
troubleshoot any connectivity issues that may arise.

Star topology provides a robust and manageable network structure, making it a popular choice
for both small and large networks. With the knowledge gained from this chapter, you can
confidently implement and maintain a star topology network in various environments.
PRACTICAL 6

Implementation Of Framing Methods: Character


Stuffing

Objective: CONFIGURATION IMPLEMENTATION OF THE DATA LINK LAYER FRAMING METHOD SUCH AS
CHARACTER STUFFING AND BIT STUFFING
Requirement: Command Prompt and Packet Tracer.

Theory:

Introduction:

The Data Link Layer of the OSI model is responsible for framing, error detection, and flow control in a
network. Two common methods for framing data at this layer are character stuffing and bit stuffing.
These methods ensure that the data sent across the network is properly framed and that special
characters or bit patterns within the data do not interfere with the framing process.

Framing is the process of breaking down data into manageable units (frames) for transmission over a
network. It includes adding header and trailer information to the data.

Character Stuffing

Character stuffing involves inserting special characters into the data to distinguish frame boundaries.
This method is typically used with text data.

• Flag: A special character (e.g., FLAG) used to denote the beginning and end of a frame.
• Escape: A special character (e.g., ESC) used to escape the FLAG character within the data.

The framing method gets around the problem of resynchronization after an error by having each
frame start with the ASCII character sequence DLE STX and the sequence DLE ETX. If the
destination ever losses the track of the frame boundaries all it has to do is look for DLE STX or
DLE ETX characters to figure out. The data link layer on the receiving end removes the DLE
before the data are given to the network layer. This technique is called character stuffing.

Program Algorithm:
Begin
Step 1: Initialize I and j as 0
Step 2: Declare n and pos as integer and a[20],b[50],ch as character
Step 3: read the string a
Step 4: find the length of the string n, i.e n-strlen(a)
Step 5: read the position, pos
Step 6: if pos > n then
Step 7: print invalid position and read again the position, pos
Step 8: endif
Step 9: read the character, ch
Step 10: Initialize the array b, b[0…5] as ’d’, ’l’, ’e’, ’s’, ’t’,’x’ respectively
Step 11: j=6;
Step 12: Repeat step[(13to22) until i<n
Step 13: if i==pos-1 then
Step 14: initialize b array,b[j],b[j+1]…b[j+6] as‘d’, ‘l’, ‘e’ ,’ch, ’d’, ‘l’,‘e’ respectively
Step 15: increment j by 7, i.e j=j+7
Step 16: endif
Step 17: if a[i]==’d’ and a[i+1]==’l’ and a[i+2]==’e’ then
Step 18: initialize array b, b[13…15]=’d’, ‘l’, ‘e’ respectively
Step 19: increment j by 3, i.e j=j+3
Step 20: endif
Step 21: b[j]=a[i]
Step 22: increment I and j;
Step 23: initialize b array,b[j],b[j+1]…b[j+6] as‘d’, ‘l’,‘e’,’e’,‘t’, ‘x’,‘\0’ respectively
Step 24: print frame after stuffing
Step 25: print b
End

Program Code: //Program for Character Stuffing


#include<stdio.h>
#include<string.h>
#include<process.h>
void main()
{ int i=0,j=0,n,pos;
char a[20],b[50],ch;
printf("Enter string\
n"); scanf("%s",&a);
n=strlen(a);
printf("Enter position\
n");
scanf("%d",&pos);
if(pos>n) {
printf("invalid position, Enter again :");
scanf("%d",&pos);}
printf("Enter the character\
n");
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; }
if(a[i]=='d' && a[i+1]=='l' && a[i+2]=='e')
{ 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("\nframe
after stuffing:\n");
printf("%s",b);
}

PRACTICAL 7
Implementation of Configuring a Router

Objective: CONFIGURE ROUTER IN LINUX WITH PACKET TRACER CISCO SIMULATOR.


Requirement
Command Prompt and Packet Tracer.

Theory:

Introduction:

In this chapter, we will explore how to configure a router using Cisco Packet Tracer, a
powerful network simulation tool, and perform basic routing configuration that could be
mirrored in a Linux environment. Packet Tracer allows for the design, configuration, and
troubleshooting of network setups in a virtual environment, making it an ideal tool for
learning and experimentation.

Objectives
1. Understand the basics of router configuration.
2. Use Cisco Packet Tracer to configure a router.
3. Simulate basic network routing using Packet Tracer.

Prerequisites
Before proceeding, ensure you have the following:

• Cisco Packet Tracer installed on your computer.


• Basic knowledge of networking concepts and the Packet Tracer interface.

Understanding Router Configuration


Routers are critical devices in networking that forward data packets between computer
networks. They perform traffic directing functions on the Internet and are essential for
connecting different subnets.

Basic Router Configuration Tasks


1. Assigning IP addresses to interfaces.
2. Configuring routing protocols.
3. Setting up static routes.
4. Verifying configuration and connectivity.
Setting Up the Network in Packet Tracer

Step 1: Launch Packet Tracer and Create a New Project

1. Open Cisco Packet Tracer.


2. Create a new project by clicking on File > New.

Step 2: Add Devices to the Workspace

1. Add a Router:
• In the device list, select Routers.
• Drag and drop a router (e.g., 1941) into the workspace.

2. Add Computers (Nodes):

• In the device list, select End Devices.


• Drag and drop two computers (e.g., PC-PT) into the workspace.

3. Add a Switch:

• In the device list, select Switches.


• Drag and drop a switch (e.g., 2960) into the workspace.

Step 3: Connect the Devices

1. Connect the Router to the Switch:

• Select the Connections tool from the toolbar.


• Choose Copper Straight-Through cable.
• Connect GigabitEthernet0/0 on the router to any port on the switch.

2. Connect the Computers to the Switch:

• Connect each computer to the switch using Copper Straight-Through


cables.

Step 4: Configure IP Addresses

Assign IP addresses to the computers and the router interfaces.

On Computers

1. Click on a computer to open its configuration window.


2. Navigate to the Desktop tab and select IP Configuration.
3. Assign IP addresses as follows:

• PC1: IP Address: 192.168.1.2, Subnet Mask: 255.255.255.0


• PC2: IP Address: 192.168.1.3, Subnet Mask: 255.255.255.0

On the Router

1. Click on the router to open its configuration window.


2. Navigate to the CLI tab to access the Command Line Interface.

Enter the following commands to configure the router:

plaintext
Copy code
Router> enable
Router# configure terminal
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# exit
Router# copy running-config startup-config

Verifying Configuration and Connectivity

Step 1: Check Interface Status


On the router CLI, use the following command to check the status of the interface:
plaintext
Copy code
Router# show ip interface brief

Ensure the GigabitEthernet0/0 interface shows the correct IP address and status as up.

Step 2: Test Connectivity with Ping

1. Open the Command Prompt on PC1.


2. Ping the router’s interface:

plaintext
Copy code
ping
192.168.1.1

3. Ensure the ping is successful. Repeat the process on PC2.


Step 3: Test Connectivity Between PCs

1. Open the Command Prompt on PC1.


2. Ping PC2:

plaintext
Copy code
ping
192.168.1.3

3. Ensure the ping is successful.


Result:
In this chapter, we covered the steps to configure a router using Cisco Packet Tracer, including
setting IP addresses, verifying connectivity, and adding static routes. By following this guide,
you should be able to set up and configure a router in a simulated environment, which will help
you understand and manage real-world networking scenarios effectively.

PRACTICAL 8
Implementation of Configuring a Switch
Objective: CONFIGURE SWITCH IN LINUX WITH PACKET TRACER CISCO SIMULATOR.

Requirement
Command Prompt and Packet Tracer.

Theory:

Introduction:

In this chapter, we will explore the process of configuring a switch in a Linux environment
using Cisco's Packet Tracer. Cisco Packet Tracer is a powerful network simulation tool that
allows users to create network topologies and emulate modern computer networks. It is an
essential tool for anyone looking to learn about network design, configuration, and
troubleshooting.

Step 1
Add one Cisco Router, two Cisco Switches, and four PCs to the program’s workspace. Then,
note the port and slot numbers of the Router’s GigabitEthernet interfaces in the workspace.

Double-click on the Router to open the IOS Command Interface.

Step 2

In the Cisco router CLI window, assign an IP address to the GigabitEthernet0/0 interface and
execute the no shutdown command to activate the interface.

Step 3

After configuring the GigabitEthernet0/0 interface, the port will be green. The meaning of this
colour is that the interface is active and working.

Step 4

To assign an IP address to the GigabitEthernet 0/1 interface and activate the port, perform the
following commands:
Step 5

In the following image, you can see that the Router’s GigabitEthernet ports are connected to
the Switches and are active.

Step 6

Now, you need to assign an IP address to the computers that you add to the topology. To do
this, click on the PC to which you will assign an IP, and on the Desktop tab, click IP
Configuration.

Then, it would be best if you addressed the PC according to the IP block of the network on
which the network is. According to the topology above, assign an IP address from block
192.168.1.0/24 as PC0 is connected to the network under the Router’s Gig0/0 interface.

Configure the IP address, subnet mask, and default gateway settings for PC0 as in the
following image.

Step 7

Click Command Prompt on PC0, and then ping the Cisco Router Gig0/0 default gateway
totest the network connection.

Step 8

This time, the TCP/IP settings of PC3 on the 192.168.2.0/24 network are configured as
follows.
Step 9

When you ping the GigabitEthernet0/1 interface (default gateway) via PC3, you can also see
that the operation was successful.

Step 10

Likewise, suppose you ping the Router’s GigabitEthernet0/1 interface via PC0. In that case,
the operation will still be successful because one Router’s main task is to communicate with
each other the different networks connected to it.

Step 11

Ping operation to PC2 computer with IP address 192.168.2.10 via PC0;

Step 12

Ping operation to PC2 computer with IP address 192.168.2.20 via PC0;


Step 13

You can examine the MAC addresses of computers when you execute the show arp command
at the Cisco router CLI command prompt.

Result:
By following the steps outlined in this chapter, you should now have a basic understanding of how to
configure a switch in a Linux environment using Cisco Packet Tracer. This knowledge is crucial for
managing and troubleshooting network devices in real-world scenarios.
PRACTICAL 9
Bit Stuffing
Objective: Bit stuffing involves inserting non-information bits into the data to break up
patterns that could be misinterpreted as frame delimiters.

Flag Sequence: A specific sequence of bits (e.g., 01111110) used to denote the beginning and
end of a frame.

Stuffed Bit: A bit inserted to ensure that the flag sequence does not appear within the data.

The new technique allows data frames to contain an arbitrary number of bits and allows
character codes with an arbitrary no of bits per character. Each frame begins and ends
with the special bit pattern, 01111110, called a flag byte. Whenever the sender's data link
layer encounters five consecutive ones in the data, it automatically stuffs a 0 bit into the
outgoing bit stream. This bit stuffing is analogous to character stuffing, in which a DLE is
stuffed into the outgoing character stream before DLE in the data.
Pro
gram Algorithm:
Begin
Step 1: Read frame length n
Step 2: Repeat step (3 to 4) until i<n(: Read values into the input frame (0’s and
1’s) i.e.
Step 3: initialize I i=0;
Step 4: read a[i] and increment i
Step 5: Initialize i=0, j=0,count =0
Step 6: repeat step (7 to 22) until i<n
Step 7: If a[i] == 1 then
Step 8: b[j] = a[i]
Step 9: Repeat step (10 to 18) until (a[k] =1 and k<n and count <5)
Step 10: Initialize k=i+1;
Step 11: Increment j and b[j]= a[k];
Step 12: Increment count ;
Step 13: if count =5 then
Step 14: increment j,
Step 15: b[j] =0
Step 16: end if
Step 17: i=k;
Step 18: increment k
Step 19: else
Step 20: b[j] = a[i]
Step 21: end if
Step 22: increment I and j
Step 23: print the frame after bit stuffing
Step 24: repeat step (25 to 26) until i< j
Step 25: print b[i]
Step 26: increment i
End

Program Code: // BIT Stuffing program


#include<stdio.h> #include<string.h>
void main() { int
a[20],b[30],i,j,k,count,n; printf("Enter
frame length:"); scanf("%d",&n);
printf("Enter input frame (0's & 1's
only):"); for(i=0;i<n;i++)
scanf("%d",&a[i]); i=0; count=1; j=0;
while(i<n) { if(a[i]==1) {
b[j]=a[i];
for(k=i+1;a[k]==1 && k<n && count<5;k++)
{ j++;
b[j]=a[k;
count++;
if(count
==5)
{ j++;
b[j]=0; }
i=k; }}
else
{ b[j]=a[
i]; } i++;
j++; }
printf("
After
stuffing
the
frame
is:");
for(i=0;i
<j;i++)
printf("
%d",b[i]
);
}

Result:

In this chapter, we covered the configuration and implementation of character stuffing


and bit stuffing methods at the Data Link Layer. These methods are crucial for ensuring
that data is correctly framed for transmission over a network, preventing special
characters or bit patterns from interfering with the framing process. By following this
guide, you can implement and test these framing methods effectively.

You might also like