0% found this document useful (0 votes)
23 views23 pages

Computer Networks Pratical

Uploaded by

anshitayadav3022
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)
23 views23 pages

Computer Networks Pratical

Uploaded by

anshitayadav3022
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/ 23

NOIDA INSTITUTE OF ENGINEERING AND

TECHNOLOGY GREATER NOIDA-201306


(An Autonomous Institute)

Affiliated to Dr. A.P.J Abdul Kalam Technical University, Uttar Pradesh, Lucknow

School of Computer Sciences & Engineering in Emerging


Technologies

Department of
CSE - Artificial Intelligence and Machine Learning

LAB FILE
On
Computer Network Lab
(ACSE0552)

(5th Semester)
Session (2024 – 2025)

Submitted by Submitted to
Your Name Mr. Rehan Ali Khan
AIML V C (Asst. Professor)
2201331530*** Dept. of CSE-AIML
Index
S.N Signatu
Experiment Date
. re
To make an UTP cable with RJ-45 connector, and build
1. and test simple network using UTP cable(crossover)and
hub-based network.

Implementation of data link layer framing method such


2. as bit stuffing Python.

Test the Network connection using ping command and


3. use of ipconfig, netstat and tracert command provided
by TCP/IP.

Implementation of CRC algorithm in any language like


4. C++, Java or Python.

Implementation of stop and wait protocol in any


5. language like C++, Java or Python.

Implementation of hamming code(7,4)code to limit the


6. noise. We have to code the bit data in to 7bit data by
adding 3parity bits.

Implementation of Caesar cipher technique & RSA


7. algorithm in any language like C++, Java or Python.

Write a program in java to find the IP address of the


8. system.

Write a program in java to find the IP address of the any


9. site if name is given.

Introduction to Network Devices: Repeater, Hub,


10. Bridge, Switch, Router, Gateways, NIC etc.

Introduction to CISCO Packet Tracer. Design Bus, Star,


11. Mesh, Ring Topology and check the connectivity using
ping command.

12. Switch configuration on CISCO Packet Tracer using CLI.


Q1. To make an UTP cable with RJ-45 connector, and build and test simple network
using UTP cable(crossover)and hub-based network.
Physical layer defines the cable or physical medium itself, e.g., thinnet, thicknet, unshielded
twisted pairs (UTP). It transmits raw bit stream over physical cable, defines cables, cards, and
physical aspects, defines NIC attachments to hardware, how cable is attached to NIC, defines
techniques to transfer bit stream to cable. All media are functionally equivalent. The main
difference is in convenience and cost of installation and maintenance. Network Cabling Cable
is the medium through which information usually moves from one network device to another.
There are several types of cable which are commonly used with LANs. In some cases, a
network will utilize only one type of cable, other networks will use a variety of cable types.
The type of cable chosen for a network is related to the network's topology, protocol, and size.
Types of cables used in networks are:
1. Unshielded Twisted Pair (UTP) Cable
2. Shielded Twisted Pair (STP) Cable
3. Coaxial Cable
4. Fiber Optic Cable
5. Wireless Media

Categories of Unshielded Twisted Pair Ethernet Cable Summary


defined by EIA/TIA
Type Use Specs Type Max.
Category 1 Voice Only Length
(Telephone Wire) 10BaseT Untwisted 100
Category 2 Local Talk - up to 4 Twisted meters
Mbit/s Pair
Category 3 Ethernet - up to 10 10Base2 Thin Coaxial 185
Mbit/s meters
Category 4 Token Ring Network - 10Base5 Thick Coaxial 500
Up to 20 Mbit/s meters
Category 5 Fast Internet - Up to 10BaseF Fiber Optic 2000
100 Mbit/s meters
Category 6 Gigabit 100BaseT Untwisted 100
Ethernet(50m) - Up Twisted meters
to 10 Gbit/s Pair
Category 7 Gigabit Ethernet 100BaseTX Untwisted 220
(100m) - Up to 10 Twisted meters
Gbit/s Pair

1. Unshielded Twisted Pair Connector


The standard connector for unshielded twisted pair cabling is an RJ-45 connector.

2. Shielded Twisted Pair (STP) Cable


A disadvantage of UTP is that it may be susceptible to radio and electrical frequency
interference. Shielded twisted pair (STP) is suitable for environments with electrical
interference; however, the extra shielding can make the cables quite bulky. Shielded
twisted pair is often used on networks using Token Ring topology.

Udit Chandra AIML - V C 2201331530195 1


3. Ethernet Cable

T-568A Straight-Through Ethernet Cable


The T-568A standard is supposed to be used in new network
installations. Most off-the-shelf Ethernet cables are still of the T-568B
standard; however, it makes no functional difference.

T-568B Straight-Through Ethernet Cable


Both the T-568A and the T-568B standard Straight-Through cables are
used most often as patch cords for Ethernet connections. If we
require a cable to connect two Ethernet devices directly together
without a hub or when connecting two hubs together, we need to use
a Crossover cable instead.

4. RJ-45 Crossover Ethernet Cable

Standard End Crossover End


Pin 1 White/Orange Pin 1 White/Green
Pin 2 Orange Pin 2 Green
Pin 3 White/Green Pin 3 White/Orange
Pin 4 Blue Pin 4 Blue
Pin 5 White/Blue Pin 5 White/Blue
Pin 6 Green Pin 6 Orange
Pin 7 White/Brown Pin 7 White/Brown
Pin 8 Brown Pin 8 Brown

Crossover Ethernet cable is to wire one end using the T-568A


standard and the other end using the T-568B standard. Another
way of remembering the color coding is to simply switch the
Green set of wires in place with the Orange set of wires.
Specifically, switch the solid Green (G) with the solid Orange, and
switch the green/white with the orange/white. By looking at a T-
568A UTP Ethernet straight-thru cable and an Ethernet crossover
cable with a T-568B end, we see that the TX (transmitter) pins are
connected to the corresponding RX (receiver) pins, plus to plus
and minus to minus. You can also see that both the blue and brown wire pairs on pins 4, 5, 7,
and 8 are not used in either standard. What you may not realize is that, these same pins 4, 5,
7, and 8 are not used or required in 100BASE-TX as well. So why bother using these wires, well
for one thing its simply easier to make a connection with all the wires grouped together.
Otherwise you'll be spending time trying to fit those tiny little wires into each of the
corresponding holes in the RJ-45 connector.

Udit Chandra AIML - V C 2201331530195 2


Deciding which cable to use:
Here’s small chart that will give an idea which cable should go where:

Situation Cable
Computer to Computer Crossover Cable
Computer to Hub Straight Through Cable
Hub Port to Hub Port Crossover Cable
Hub uplink to Hub Port Straight Through Cable
Computer to Broadband Router
Straight Through Cable
Port
Computer to Switch Straight Through Cable
Computer to Cable Modem Crossover Cable
Cable Modem to Router Crossover Cable
Hub Uplink to Switch Port Straight Through Cable

1. Two computers scenario:


If we have only two computers, it will need two NICs and a crossover cable. If you also require
both computers to have internet access, then you could either:
a. Install another NIC (connect it to the b. Or, get a router (Connect it using a
cable/DSL modem with a crossover crossover cable to the cable modem
cable) or fax modem in one and and connect the computers to the
connect it to the internet, then use a built-in switch on the router. Some
software proxy, ICS, Wingate, etc. to routers don't have built in switches,
share the internet. in this case you will need to get a
switch or hub.

2. More than two computers scenario (hub/switch cascading):


With more computers we will need a hub/switch
and straight through cables, connect all
computers to the hub/switch with straight
through cable. If you run out of ports then add
another hub/switch to your network. Connect
the uplink of one hub/switch to a port on the
other hub/switch using a straight through cable,
or connect port to port using a crossover cable.
If we have more than two hubs/switches, then connect all the hub/switches using uplink ports
and straight through cables, to regular ports on a main hub/switch.

If you require internet connectivity:


(a) Install another NIC (connect it to the cable/DSL modem with a crossover cable), or fax
modem in one machine and connect it to the internet. Use a software proxy, ICS, Wingate,
etc. to share the internet. Now connect the gateway computer and the rest of the computers
to the hub's ports using straight through cables.

Udit Chandra AIML - V C 2201331530195 3


(b) Using a broadband router, connect a cable modem with a crossover cable to the WAN port
of the router, then connect the other computers to the router's LAN ports If you do not have
enough ports then get more hub/switches. Connect the uplink ports to the router's LAN port
with straight through cables and connect your computers to the hubs/switches.

Procedure:
1. Start on one end of cable and strip the cable jacket off using a stripper.

2. Spread, untwist the pairs, and arrange the wires in the order of the desired cable end.
Flatten the end between your thumb and forefinger. Trim the ends of the wires so they
are even with one another.

3. Hold the RJ-45 plug with the clip facing down.Push the wires firmly into the plug. Inspect
each wire is flat even at the front of the plug. Check the order of the wires. Check that
the jacket is fitted right against the stop of the plug. Carefully hold the wire and firmly
crimp the RJ-45 with the crimper.

4. Check the color orientation, check that the crimped connection is not about to come
apart, and check to see if the wires are flat against the front of the plug.

5. Similarly make end 2 according to the color coding for straight through cable or
crossover cable on the basis of requirement.

Connecting PC's using direct cable UTP:


1. use crossover UTP cable.
2. Insert RJ45 connector to both PC's NIC card.
3. restart both computers and both of them detect the network after logon.

Connecting PC to hub:
1. Use straight through UTP cable.
2. Insert RJ45 connector to computer's NIC card and other end to HUB.
3. Switch on power of HUB and computer.

Udit Chandra AIML - V C 2201331530195 4


Q2. Implementation of data link layer framing method such as bit stuffing Python.

def bitStuffing(N, arr):


brr = [0] * 30
k=0
i=0
j=0
while (i < N):
if (arr[i] == 1):
count = 1
brr[j] = arr[i]
k=i+1
while True:
if not (k < N and arr[k] == 1 and count < 5):
break
j += 1
brr[j] = arr[k]
count += 1

if (count == 5):
j += 1
brr[j] = 0
i=k
k += 1
else:
brr[j] = arr[i]
i += 1
j += 1

for i in range(0, j):


print(brr[i], end="")

if __name__ == "__main__":
N = 10
arr = [0,1,0,1,1,0,0,1,1,0]
bitStuffing(N, arr)

Output:
For N=9 and arr=[1,0,1,1,1,1,1,0,1] where there are five consecutive set bits:

For N=10 and arr=[0,1,0,1,1,0,0,1,1,0]where there are no consecutive sequences of five set
bits:

Udit Chandra AIML - V C 2201331530195 5


Q3. Test the Network connection using ping command and use of ipconfig, netstat
and tracert command provided by TCP/IP.
1. ipconfig

Udit Chandra AIML - V C 2201331530195 6


2. tracert

tracert on google.com

Udit Chandra AIML - V C 2201331530195 7


3. netstat

Udit Chandra AIML - V C 2201331530195 8


Q4. Implementation of CRC algorithm in any language like C++, Java or Python.

import zlib

def crc32(data: str|bytes) -> int:

try:
if isinstance(data, str):
data = data.encode()
return zlib.crc32(data) & 0xffffffff

except Exception as e:
print(f"Error: {e}")
return None

if __name__ == "__main__":
data = "Never have I ever seen a CRC32 checksum"
crc_chksm = crc32(data)
print(f"CRC32: {crc_chksm:#010x}")

Output:

Udit Chandra AIML - V C 2201331530195 9


Q5. Implementation of stop and wait protocol in any language like C++, Java or
Python.
import time
import random

class Packet:
def __init__(self, seq_num, data):
self.seq_num = seq_num
self.data = data

class Sender:
def __init__(self):
self.seq_num = 0
self.timeout = 3

def send_packet(self, packet):


print(f"Sender: Sending packet with seq_num: {packet.seq_num} and data:
{packet.data}")
time.sleep(1)

def receive_ack(self):
time.sleep(1)
return True if random.random() < 0.8 else False

def wait_for_ack(self):
start_time = time.time()
while time.time() - start_time < self.timeout:
if self.receive_ack():
return True
return False

class Receiver:
def __init__(self):
self.exp_seq_num = 0

def receive_packet(self, packet):


if packet.seq_num == self.exp_seq_num:
print(f"Receiver: Received packet with seq_num: {packet.seq_num} and data:
{packet.data}")
self.exp_seq_num += 1
return True

else:
print(f"Receiver: Discarding out of order packet with seq_num: {packet.seq_num}")
return False

def send_ack(self, ack):


time.sleep(1)
print(f"Receiver: Sending ACK" if ack else "Receiver: Sending NAK")

def main():
sender = Sender()
receiver = Receiver()
window_size = 1

Udit Chandra AIML - V C 2201331530195 10


packets_to_send = [
Packet(0, "Hola"),
Packet(1, "Amigo"),
Packet(2, "This"),
Packet(3, "is"),
Packet(4, "Stop and Wait"),
]

for packet in packets_to_send:


while True:
sender.send_packet(packet)
if sender.wait_for_ack():
break

while True:
if receiver.receive_packet(packet):
receiver.send_ack(True)
break
else:
receiver.send_ack(False)
print()

if __name__ == "__main__":
main()

Output:

Udit Chandra AIML - V C 2201331530195 11


Q6. Implementation of hamming code(7,4)code to limit the noise. We have to code
the bit data in to 7bit data by adding 3parity bits.

def calculate_parity(data):
p1 = data[0]^data[1]^data[3]
p2 = data[0]^data[2]^data[3]
p3 = data[1]^data[2]^data[3]
return p1,p2,p3

def encode(data):
if len(data)!=4:
print("Invalid data")
return

p1,p2,p3 = calculate_parity(data)
encoded_data = [p1,p2,data[0],p3,data[1],data[2],data[3]]
return encoded_data

def main():
data = [1,0,1,1]

print("Original 4bit Data: ",data)

encoded_data = encode(data)
print("Encoded 7bit data (with parity): ",encoded_data)

if __name__ == '__main__':
main()

Output:

Udit Chandra AIML - V C 2201331530195 12


Q7. Implementation of Caesar cipher technique & RSA algorithm in any language like
C++, Java or
Python.

Implementation of Ceaser Cipher Algorithm:


def caesar_encrypt(text, key):
result = ""
for c in text:
if c.isalpha():
shift = ord('A') if c.isupper() else ord('a')
result += chr((ord(c) - shift + key) % 26 + shift)
else:
result += c
return result

def ceaser_decrypt(text, key):


return caesar_encrypt(text, -key)

# Usage
text = "This is a secret message!"
key = 3

encrypted_text = caesar_encrypt(text, key)


print("Encrypted Text:", encrypted_text)

decrypted_text = ceaser_decrypt(encrypted_text, key)


print("Decrypted Text:", decrypted_text)

Output:

Udit Chandra AIML - V C 2201331530195 13


Implementation of RSA Algorithm:
import random
import sympy

def gen_keypair(p,q):
n = p*q
phi = (p-1)*(q-1)

e = random.randrange(1, phi)
while sympy.gcd(e, phi) != 1:
e = random.randrange(1, phi)

d = sympy.mod_inverse(e, phi)
return ((e, n), (d, n))

def rsa_encrypt(public_key, text):


e, n = public_key
result = [pow(ord(c), e, n) for c in text]
return result

def rsa_decrypt(private_key, text):


d, n = private_key
result = [chr(pow(c, d, n)) for c in text]
return ''.join(result)

# Usage
p = 61
q = 53
public, private = gen_keypair(p, q)
plaintext = "This is a secret message!"

encrypted_text = rsa_encrypt(public, plaintext)


decrypted_text = rsa_decrypt(private, encrypted_text)
print("Encrypted:", encrypted_text)
print("Decrypted Text:", decrypted_text)

Output:

Udit Chandra AIML - V C 2201331530195 14


Q8. Write a program in java to find the IP address of the system.

import java.net.InetAddress;
import java.net.UnknownHostException;

public class FindIPAddress {


public static void main(String[] args) {
try {
InetAddress ip = InetAddress.getLocalHost();
System.out.println("IP address of the system: " + ip.getHostAddress());
}
catch (UnknownHostException e) {
System.out.println("Unable to find IP address.");
}
}
}

Output:

Udit Chandra AIML - V C 2201331530195 15


Q9. Write a program in java to find the IP address of the any site if name is given.

import java.net.InetAddress;
import java.net.UnknownHostException;
import java.util.Scanner;

public class FindIPAddress {


public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.print("Enter the website name (e.g., google.com): ");
String website = scanner.nextLine();

try {
InetAddress ip = InetAddress.getByName(website);
System.out.println("IP address of " + website + " is: " + ip.getHostAddress());
}

catch (UnknownHostException e) {
System.out.println("Could not find IP address for the given website.");
}

finally {
scanner.close();
}
}
}

Output:

Udit Chandra AIML - V C 2201331530195 16


Q10. Introduction to Network Devices: Repeater, Hub, Bridge, Switch, Router,
Gateways, NIC etc.

Repeater
a repeater is an electronic device that receives a signal and retransmits it. Repeaters are used
to extend transmissions so that the signal can cover longer distances or be received on the
other side of an obstruction. Some types of repeaters broadcast an identical signal, but alter
its method of transmission, for example, on another frequency or baud rate.
There are several different types of repeaters; a telephone repeater is an amplifier in a
telephone line, an optical repeater is an optoelectronic circuit that amplifies the light beam in
an optical fiber cable; and a radio repeater is a radio receiver and transmitter that retransmits
a radio signal.
A broadcast relay station is a repeater used in broadcast radio and television.

Hub
An Ethernet hub, active hub, network hub, repeater hub, multiport repeater, or simply hub is a
network hardware device for connecting multiple Ethernet devices together and making them
act as a single network segment. It has multiple input/output (I/O) ports, in which a signal
introduced at the input of any port appears at the output of every port except the original
incoming. A hub works at the physical layer. A repeater hub also participates in collision
detection, forwarding a jam signal to all ports if it detects a collision.

Active Hub: These are the hubs which have Passive Hub: These are the hubs which
their own power supply and can clean, collect wiring from nodes and power supply
boost and relay the signal along with the from active hub. These hubs relay signals
network. It serves both as a repeater as onto the network without cleaning and
well as wiring centre. These are used to boosting them and can't be used to extend
extend the maximum distance between the distance between nodes.
nodes.

Bridge
A network bridge is a computer networking device that creates a single, aggregate network
from multiple communication networks or network segments. This function is called network
bridging. Bridging is distinct from routing. Routing allows multiple networks to communicate
independently and yet remain separate, whereas bridging connects two separate networks as
if they were a single network. In the OSI model, bridging is performed in the data link layer. If
one or more segments of the bridged network are wireless, the device is known as a wireless
bridge.

Transparent Bridge: These are the bridge in which the stations are completely unaware of the
bridge's existence i.e. whether or not a bridge is added or deleted from network,
reconfiguration of the stations is unnecessary. These bridges make use of two processes i.e.
bridge forwarding and bridge learning.

Udit Chandra AIML - V C 2201331530195 17


Source Routing Bridge: In these bridges, routing operation is performed by source station and
the frame specifies which route to follow. The hot can discover frame by sending a special
frame called discovery frame, which spreads through the entire network using all possible
paths to destination.
Switch
A network switch (also called switching hub, bridging hub, Ethernet switch, and, by the IEEE,
MAC bridge) is networking hardware that connects devices on a computer network by using
packet switching to receive and forward data to the destination device. A network switch is a
multiport network bridge that uses MAC addresses to forward data at the data link layer (layer
2) of the OSI model. Some switches can also forward data at the network layer (layer 3) by
additionally incorporating routing functionality. Such switches are commonly known as layer-3
switches or multilayer switches.

Router
A router is a computer and networking device that forwards data packets between computer
networks, including internetworks such as the global Internet. A router is connected to two or
more data lines from different IP networks. When a data packet comes in on a line, the router
reads the network address information in the packet header to determine the ultimate
destination. Then, using information in its routing table or routing policy, it directs the packet
to the next network on its journey. Data packets are forwarded from one router to another
through an internetwork until it reaches its destination node.
The most familiar type of IP routers are home and small office routers that forward IP packets
between the home computers and the Internet. More sophisticated routers, such as enterprise
routers, connect large business or ISP networks to powerful core routers that forward data at
high speed along the optical fiber lines of the Internet backbone.

Gateway
A gateway is a piece of networking hardware or software used in telecommunications
networks that allows data to flow from one discrete network to another. Gateways are distinct
from routers or switches in that they communicate using more than one protocol to connect
multiple networks and can operate at any of the seven layers of the OSI model.
The term gateway can also loosely refer to a computer or computer program configured to
perform the tasks of a gateway, such as a default gateway or router, and in the case of HTTP,
gateway is also often used as a synonym for reverse proxy. It can also refer to a device
installed in homes that combines router and modem functionality into one device, used by
ISPs, also called a residential gateway.

NIC
A network interface controller (NIC, also known as a network interface card, network adapter,
LAN adapter and physical network interface) is a computer hardware component that
connects a computer to a computer network.
Early network interface controllers were commonly implemented on expansion cards that
plugged into a computer bus. The low cost and ubiquity of the Ethernet standard means that
most newer computers have a network interface built into the motherboard, or is contained
into a USB-connected dongle.
Modern network interface controllers offer advanced features such as interrupt and DMA
interfaces to the host processors, support for multiple receive and transmit queues,
partitioning into multiple logical interfaces, and on-controller network traffic processing such
as the TCP offload engine.

Udit Chandra AIML - V C 2201331530195 18


Q11. Introduction to CISCO Packet Tracer. Design Bus, Star, Mesh, Ring Topology and
check the connectivity using ping command.

CISCO 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. The software
allows users to simulate the configuration of Cisco routers and switches using a simulated
command line interface. Packet Tracer makes use of a drag and drop user interface, allowing
users to add and remove simulated network devices as they see fit. The software is mainly
focused towards Certified Cisco Network Associate Academy students as an educational tool
for helping them learn fundamental CCNA concepts.
Packet Tracer can be run on Linux and Microsoft Windows. Similar Android and iOS apps are
also available. Packet Tracer allows users to create simulated network topologies by dragging
and dropping routers, switches and various other types of network devices. A physical
connection between devices is represented by a "cable" item. Packet Tracer supports an array
of simulated Application Layer protocols, as well as basic routing with RIP, OSPF, EIGRP, BGP,
to the extents required by the current CCNA curriculum. As of version 5.3, Packet Tracer also
supports the Border Gateway Protocol.
In addition to simulating certain aspects of computer networks, Packet Tracer can also be used
for collaboration. As of Packet Tracer 5.0, Packet Tracer supports a multi-user system that
enables multiple users to connect multiple topologies together over a computer network.
Packet Tracer also allows instructors to create activities that students have to complete.
Packet Tracer is often used in educational settings as a learning aid. Cisco Systems claims that
Packet Tracer is useful for network experimentation.
Packet Tracer allows students to design complex and large networks, which is often not
feasible with physical hardware, due to costs. Packet Tracer is commonly used by CCNA
Academy students, since it is available to them for free. However, due to functional
limitations, it is intended by CISCO to be used only as a learning aid, not a replacement for
Cisco routers and switches. The application itself only has a small number of features found
within the actual hardware running a current Cisco IOS version. Thus, Packet Tracer is
unsuitable for modelling production networks. It has a limited command set, meaning it is not
possible to practice all of the IOS commands that might be required. Packet Tracer can be
useful for understanding abstract networking concepts, such as the Enhanced Interior
Gateway Routing Protocol by animating these elements in a visual form. Packet Tracer is also
useful in education by providing additional components, including an authoring system,
network protocol simulation and improving knowledge an assessment system.

Topologies:
Design of different Topologies and check their connectivity using ping command.

1. Bus Topology
A bus topology is a topology for a Local Area Network (LAN) in which all the nodes are
connected to a single cable. The cable to which the nodes connect is called a
"backbone". If the backbone is broken, the entire segment fails.

2. Mesh Topology
Mesh topology is a type of networking where all nodes cooperate to distribute data
amongst each other.

3. Ring Topology
A ring network is a network topology in which each node connects to exactly two other
nodes, forming a single continuous pathway for signals through each node a ring. Data
travels from node to node, with each node along the way handling every packet.

Udit Chandra AIML - V C 2201331530195 19


4. Star Topology
A star topology is a topology for a Local Area Network (LAN) in which all nodes are
individually connected to a central connection point, like a hub or a switch. A star takes
more cable than e.g. a bus, but the benefit is that if a cable fails, only one node will be
brought down.

Udit Chandra AIML - V C 2201331530195 20


Q12. Switch configuration on CISCO Packet Tracer using CLI.

Steps:
1. Click on the switch in Packet Tracer.
2. Go to the CLI tab.
3. Enter configuration mode
4. Then:

Switch> enable
Switch# configure terminal
Switch(config)# hostname MySwitch
MySwitch(config)# interface vlan 1
MySwitch(config-if)# ip address 192.168.0.113 255.255.255.0
MySwitch(config-if)# no shutdown
MySwitch(config-if)# exit
MySwitch(config)# ip default-gateway 192.168.1.1
MySwitch(config)# line console 0
MySwitch(config-line)# password cisco
MySwitch(config-line)# login
MySwitch(config-line)# exit
MySwitch(config)# line vty 0 4
MySwitch(config-line)# password cisco
MySwitch(config-line)# login
MySwitch(config-line)# exit
MySwitch(config)# ip domain-name example.com
MySwitch(config)# crypto key generate rsa
MySwitch(config)# 1024
MySwitch(config)# line vty 0 4
MySwitch(config-line)# transport input ssh
MySwitch(config-line)# exit

Udit Chandra AIML - V C 2201331530195 21

You might also like