Download as pdf or txt
Download as pdf or txt
You are on page 1of 18

Utkarsh Panchal

21100BTCSDSI09501

Experiment:-8
Aim:- Simulate LAN using hub, also write steps and find out differences
between two devices hub and switch.

To simulate a LAN (Local Area Network) using a hub, you'll need the following
equipment:

1. Hub (Ethernet hub)

2. Ethernet cables

3. Computers/devices to connect to the LAN


Utkarsh Panchal
21100BTCSDSI09501

Here are the steps to set up a LAN using a hub:

1. Connect the hub: Plug in the power adapter for the hub and connect it to a
power source. Then, connect each device (computers, printers, etc.) to the hub
using Ethernet cables. Each device should have its own cable connected to
one of the ports on the hub.
2. Configure devices: Ensure that the devices connected to the hub are
configured with appropriate network settings, such as IP addresses, subnet
masks, and default gateways. You can assign these settings manually or
configure them to obtain an IP address automatically via DHCP if your
network supports it.
3. Test connectivity: Once all devices are connected and configured, test
connectivity between them by attempting to ping one device from another. If
the configuration is correct and the connections are properly established, you
should be able to communicate between devices within the LAN.

Differences Between Hub and Switch:

1. Functionality :
• Hub: A hub operates at the physical layer (Layer 1) of the OSI model. It
simply receives incoming data packets from one port and broadcasts
them out to all other ports.
• Switch: A switch operates at the data link layer (Layer 2) of the OSI
model. It intelligently forwards data packets only to the port where the
destination device is connected, based on MAC addresses.
2. Packet Handling :
• Hub: Broadcasts all incoming packets to all ports, causing network
congestion and potential collisions.
• Switch: Learns the MAC addresses of devices connected to its ports and
forwards packets only to the port where the destination device is
located, reducing network congestion and improving efficiency.
3. Bandwidth Usage :
• Hub: Shares available bandwidth among all connected devices, leading
to slower network speeds as more devices are added.
• Switch: Provides dedicated bandwidth for each port, allowing for full-
speed communication between devices simultaneously.
4. Security :
• Hub: Lacks security features, as all data transmitted through the hub is
visible to all connected devices.
• Switch: Offers better security as it isolates traffic between devices,
reducing the risk of unauthorized access to data.
Utkarsh Panchal
21100BTCSDSI09501

Experiment:-9
Aim:- Create a simulation on packet tracer for connection of two
networks using one router.
1. Open Cisco Packet Tracer: If you don't have Packet Tracer installed, you can
download it from the Cisco Networking Academy website.

2. Create the LANs:


• Click on the "End Devices" category in the bottom-left corner.
• Drag and drop "Generic" computers onto the workspace to
represent devices in each LAN.
• Connect the computers within each LAN using the "Copper Straight-
Through" cable from the "Connections" category.
3. Add a Router:
• Click on the "Routers" category.
• Drag and drop a router onto the workspace.
• Connect one end of the "Copper Straight-Through" cable to one of
the router's FastEthernet interfaces (e.g., FastEthernet0/0).
Utkarsh Panchal
21100BTCSDSI09501

• Connect the other end of the cable to a computer in the first LAN.
4. Configure IP Addresses:
• Click on the router to select it, then click on the "CLI" (Command
Line Interface) tab at the bottom.
• Enter the following commands to configure the router's interfaces
and

Replace <LAN1_IP_ADDRESS> and <LAN2_IP_ADDRESS> with the IP addresses


you want to assign to the router's interfaces for each LAN, and
<SUBNET_MASK> with the appropriate subnet mask.

Test Connectivity:
Click on each computer in both LANs and configure their IP addresses, subnet
masks, and default gateways to match the respective LAN settings.
Once configured, try to ping a device from one LAN to another. If everything is
configured correctly, you should see successful pings.
Utkarsh Panchal
21100BTCSDSI09501

Experiment:-10
Aim:- Create a simulation on packet tracer for connection of two or more
networks using one router.
Step 1: Add the required devices as shown below. We will add PCs
for now and connect them with wire and switch to form a separate
network.

Step 2: Go to the IP configuration tab of each Pcs and assign IP


addresses.
Utkarsh Panchal
21100BTCSDSI09501

Step 3: To link these two networks we

a Router and connected the network to the router using wire.

Step 4: The next step is to configure the Router. Click on the


router and go to CLI and enter en command.

Step 5: Now run these commands in sequence.


Utkarsh Panchal
21100BTCSDSI09501

Step 5: Now to check the network connection we will ping a device


from one network to the other.

>> ping 192.168.2.2

As the connection has been established and therefore we are getting


0% lost.
Utkarsh Panchal
21100BTCSDSI09501

Experiment:-11

Aim:- Create a simulation for remote login using packet tracer.

1. Setting up the network:


• Place two devices on the Packet Tracer workspace: a PC and a
Router.
• Connect the PC to one of the Router's Ethernet ports.
• Connect the Router to the Internet cloud.
2. Configuring the Router:
• Access the Router's CLI (Command Line Interface) by clicking on it
and selecting "CLI".
• Configure the router with a hostname, enable a password, and
generate SSH keys. Here's an example:

Configure an IP address on the Router's Ethernet interface:


Utkarsh Panchal
21100BTCSDSI09501

• Enable SSH and set the login credentials:

Configuring the PC:


• Click on the PC, select "Desktop"-> "Terminal".
• Use the ssh command to connect to the Router:

• Now, initiate the SSH connection from the PC to the Router:

Enter the password when prompted.


Verification:
Once logged in, you should have access to the Router's CLI from the PC.
Utkarsh Panchal
21100BTCSDSI09501

Experiment:-12
Aim:- Create a remote login on two different machines.
Certainly! Let's set up remote login on two different machines
using SSH.
1. Setting up the network:
• Place three devices on the Packet Tracer workspace: two PCs and a
Router.
• Connect each PC to one of the Router's Ethernet ports.
• Connect the Router to the Internet cloud.
2. Configuring the Router:
• Follow the same steps as before to configure the Router with SSH
as described in the previous answer.
3. Configuring the PCs:
• Click on each PC, select "Desktop" -> "Terminal".
• Use the ssh command to connect to the Router:

Enter the password when prompted for both PCs.


Utkarsh Panchal
21100BTCSDSI09501

Verification:
Once logged in, you should have access to the Router's CLI from both
PCs.
That's it! You've set up remote login on two different machines using
SSH on Packet Tracer. You can further explore features like setting up
different user accounts with different privileges.
Utkarsh Panchal
21100BTCSDSI09501

Experiment:-13
Aim:- Implement program for routing algorithms.
o In order to transfer the packets from source to the destination, the network
layer must determine the best route through which packets can be transmitted.
o Whether the network layer provides datagram service or virtual circuit service,
the main job of the network layer is to provide the best route. The routing
protocol provides this job.
o The routing protocol is a routing algorithm that provides the best path from
the source to the destination. The best path is the path that has the "least-cost
path" from source to the destination.
o Routing is the process of forwarding the packets from source to the destination
but the best route to send the packets is determined by the routing algorithm.
Utkarsh Panchal
21100BTCSDSI09501

Program:-
Utkarsh Panchal
21100BTCSDSI09501
Utkarsh Panchal
21100BTCSDSI09501

Experiment:-14
Aim:- Implement program for socket programming.
Program:-
Utkarsh Panchal
21100BTCSDSI09501

Client Code:
Utkarsh Panchal
21100BTCSDSI09501

Experiment:-15
Aim:- Implement program for error detection and correction technique.
Here's a Python implementation of a (7, 4) Hamming Code, which encodes 4 bits of data into
7 bits by adding 3 parity bits:
Utkarsh Panchal
21100BTCSDSI09501

This implementation allows you to encode a 4-bit data sequence into a 7-


bit Hamming encoded message, introduce a simulated error, and then
decode the message while correcting the error. You can change the data
variable to encode different sequences.

You might also like