0% found this document useful (0 votes)
44 views

CN 13

Uploaded by

Dhruv Modi
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)
44 views

CN 13

Uploaded by

Dhruv Modi
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/ 52

Computer network (3150710) 230133107005

Laboratory Manual for

Coputer Networks(3150710)
B.E. Semester 5
Computer Engineering

Government Engineering College,


Gandhinagar
Government Engineering College, Gandhinagar

Page 1
Computer network (3150710) 230133107005

Certificate

This is to certify that Mr./Ms. ________________________________________


Enrollment No. _______________of B.E. Semester _____ Computer
Engineering of this Institute (GTU Code: 13) has satisfactorily completed the
Practical / Tutorial work for the subject _____________________for the
academic year 2024 - 2025.

Place: __________ Date:

__________

Name and Sign of Faculty member

Head of the Department

Page 2
Computer network (3150710) 230133107005

Index

Sr.No Name of The Program Page No. Date Signature

1 Study of different network devices in detail


Repeater, Hub, Network Bridge, Switch,
Router, Gateway, Brouter
2 Study of basic network commands and
configurations in detail Ifconfig|ipconfig,
ping, tracert|traceroute, netstat etc
3 Implement basic Client Server Socket
program for daytime server and daytime
client
4 Implement basic Client Server Socket
program for chat server and chat client
5 Create Mesh, ring, bus, star and tree
topology in packet tracer and assign
appropriate IP addresses to devices.
Describe complete configuration procedure.
6 Create a sub network using two switches,
eight computers and connect both sub
network using router in packet tracer and
assign appropriate IP addresses to devices.
Describe complete configuration procedure
7 Create a network topology with four host
machines, local and authoritative DNS
server and web server. Describe complete
configuration procedure.
8 Implement the concept of dynamic routing
using Network Simulator
9 Implement the concept of VLAN using
Network Simulator.
10 Packet capture and header analysis by
wireshark (TCP, UDP, IP)

Page 3
Computer network (3150710) 230133107005

Institute’s Vision
• To be a premier engineering institution, imparting quality education for
innovative solutions relevant to society and environment.

Institute’s Mission
• To develop human potential to its fullest extent so that intellectual and
innovative engineers can emerge in a wide range of professions.
• To advance knowledge and educate students in engineering and other areas
of scholarship that will best serve the nation and the world in future.
• To produce quality engineers, entrepreneurs and leaders to meet the present
and future needs of society as well as environment.
Department’s Vision
• To achieve excellence for providing value based education in Computer
Engineering through innovation, team work and ethical practices.
Department’s Mission
• To produce computer science and engineering graduates according to the
needs of industry, government, society and scientific community.
• To develop partnership with industries, government agencies and R and D
Organizations
• To motivate students/graduates to be entrepreneurs.
• To motivate students to participate in reputed conferences, workshops,
symposiums, seminars and related technical activities
Program Educational Objectives (PEOs)
• To provide students with a strong foundation in the mathematical, scientific
and engineering fundamentals necessary to formulate, solve and analyze
engineering problems and to prepare them for graduate studies, R and D,
consultancy and higher learning.
• To develop an ability to analyze the requirements of the software,
understand the technical specifications, design and provide novel
engineering solutions and efficient product designs.

Page 4
Computer network (3150710) 230133107005

• To provide exposure to emerging cutting edge technologies, adequate


training and opportunities to work as teams on multidisciplinary projects
with effective communication skills and leadership qualities.
• To prepare the students for a successful career and work with values and
social concern bridging the digital divide and meeting the requirements of
Indian and multinational companies.
• To promote student awareness on the life-long learning and to introduce
them to professional ethics and codes of professional practice
Program Specific Outcomes (PSOs)

• Design ,develop, test and evaluate computer based systems by applying


standard software engineering practices and strategies in the area of
algorithms, web design, data structure, and computer network
• Apply knowledge of ethical principles required to work in a team as well as
to lead a team

Course outcomes:
1 Explain the basic terminologies used in networking and layered architecture of computer
network.
2 Comprehend basic protocols of application layer and how they can be used to assist
in network design and implementation.
3 Describe and implement the essential principles of a connectionless and connection-
oriented protocols used for reliable data transfer, flow control and congestion control.

4 Design network architecture, assign IP addressing and apply various routing algorithms
to find shortest paths for network-layer packet delivery.
5 Illustrate different link layer terminologies like error detection-correction, Multiple
access protocol and Link layer addressing used in network.

Page 5
Computer network (3150710) 230133107005

Practical 2
1. Ipconfig- Displays detailed information about all adapters, including the IP
address, subnet mask, default gateway, DHCP server, and DNS servers.

2. Ping- primary TCP/IP command used to troubleshoot connectivity, reachability,


and name resolution

3. Tracert- tool determines the route to a destination by sending ICMP packets to


the destination in packets, tracert uses varying IP Time-To-Live (TTL) values

Page 6
Computer network (3150710) 230133107005

4. Route- The route command allows you to make manual entries into the network
routing tables. The route command distinguishes between routes to hosts and
routes to networks by interpreting the network address of the Destination
variable, which can be specified either by symbolic name or numeric address.

5. Hostname- The hostname command displays the name of the current host system.

6. Pathping - The pathping command is a command-line utility tool in Windows


operating systems. It is commonly used to troubleshoot network issues,
particularly the ones related to latency and network performance.

Page 7
Computer network (3150710) 230133107005

7. Nslookup - Nslookup is the name of a program that lets users enter a host name
and find out the corresponding IP address or domain name system (DNS) record.

8. Arp - The arp command displays and modifies the Internet-toadapter address
translation tables used by the Address in Networks and communication
management.

Page 8
Computer network (3150710) 230133107005

9. Getmac- it is use to enter the MAC address into a network analyzer, or when you
need to know what protocols are currently in use on each network adapter on a
computer.

Conclusion:
In this practical, basic network commands like ifconfig/ipconfig, ping, tracert/traceroute, and
netstat were studied. These commands are essential for network diagnostics, allowing users to
configure interfaces, check connectivity, trace routes, and view active connections.

Signature of Faculty:
Practical 3
Implement basic Client Server Socket program for daytime server and
daytime client
CODE:-

DaytimeServer.java

import java.io.IOException;
import java.io.OutputStream;
import java.net.ServerSocket;
import java.net.Socket;
import java.text.SimpleDateFormat;
import java.util.Date;

public class DaytimeServer {


public static void main(String[] args) {
int port = 6969;
try (ServerSocket serverSocket = new ServerSocket(port)) {
System.out.println("Daytime server is running on port " + port + "...");

while (true) {

Page 9
Computer network (3150710) 230133107005

try (Socket clientSocket = serverSocket.accept()) {


System.out.println("Connection from " + clientSocket.getInetAddress());

String currentTime = new SimpleDateFormat("yyyy-MM-dd


HH:mm:ss").format(new Date());

// Send the current time to the client


OutputStream outputStream = clientSocket.getOutputStream();
outputStream.write(currentTime.getBytes());
outputStream.flush();
}
}
} catch (IOException e) {
System.err.println("Error occurred: " + e.getMessage());
}
}
}
DaytimeClient.java

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;

public class DaytimeClient {


public static void main(String[] args) {
String serverAddress = "localhost";
int port = 6969;

try (Socket socket = new Socket(serverAddress, port)) {


BufferedReader in = new BufferedReader(new
InputStreamReader(socket.getInputStream()));
String currentTime = in.readLine();
System.out.println("Current date and time from the server: " + currentTime);
} catch (IOException e) {
System.err.println("Error occurred: " + e.getMessage());
}
}
}
OUTPUT:

Page 10
Computer network (3150710) 230133107005

Conclusion:
In this practical, a basic client-server socket program was implemented where the server provides
the current date and time to the client, demonstrating fundamental socket communication in
networking.

Signature of Faculty:

Practical 4
Implement basic Client Server Socket program for chat server and chat client

Code:

Chat Server Code:


import java.io.*;
import java.net.*;
import java.util.*;

public class ChatServer {


private static Set<PrintWriter> clientWriters = new HashSet<>();

public static void main(String[] args) {


int port = 12345; // You can change the port if needed
try (ServerSocket serverSocket = new ServerSocket(port)) {
System.out.println("Chat server is running on port " + port + "...");
while (true) {
new ClientHandler(serverSocket.accept()).start();
}
} catch (IOException e) {
System.err.println("Error occurred: " + e.getMessage());
}
}

Page 11
Computer network (3150710) 230133107005

private static class ClientHandler extends Thread {


private Socket socket;
private PrintWriter out;
private BufferedReader in;
private String clientName;

public ClientHandler(Socket socket) {


this.socket = socket;
}

public void run() {


try {
in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
out = new PrintWriter(socket.getOutputStream(), true);
synchronized (clientWriters) {
clientWriters.add(out);
}

out.println("Enter your name:");


clientName = in.readLine();
out.println("Welcome to the chat, " + clientName + "!");
broadcast(clientName + " has joined the chat.");

String message;
while ((message = in.readLine()) != null) {
System.out.println("Received: " + message);
broadcast(clientName + ": " + message);
}
} catch (IOException e) {
System.err.println("Error occurred: " + e.getMessage());
} finally {
try {
socket.close();
} catch (IOException e) {
System.err.println("Error closing socket: " + e.getMessage());
}
synchronized (clientWriters) {
clientWriters.remove(out);
}
broadcast(clientName + " has left the chat.");
}
}

private void broadcast(String message) {


synchronized (clientWriters) {
for (PrintWriter writer : clientWriters) {

Page 12
Computer network (3150710) 230133107005

writer.println(message);
}
}
}
}
}

Chat Client Code:


import java.io.*;
import java.net.*;

public class ChatClient {


public static void main(String[] args) {
String serverAddress = "localhost";
int port = 12345;

try (Socket socket = new Socket(serverAddress, port);


PrintWriter out = new PrintWriter(socket.getOutputStream(), true);
BufferedReader in = new BufferedReader(new
InputStreamReader(socket.getInputStream()));
BufferedReader console = new BufferedReader(new
InputStreamReader(System.in))) {

new Thread(() -> {


String serverMessage;
try {
while ((serverMessage = in.readLine()) != null) {
System.out.println(serverMessage);
}
} catch (IOException e) {
System.err.println("Error reading from server: " + e.getMessage());
}
}).start();

String userInput;
while ((userInput = console.readLine()) != null) {
out.println(userInput);
}
} catch (IOException e) {
System.err.println("Error occurred: " + e.getMessage());
}
}
}

Page 13
Computer network (3150710) 230133107005

OUTPUT:

Conclusion:
In this practical, a basic client-server socket program for real-time chat was implemented,
demonstrating bidirectional communication between client and server using sockets.

Signature of Faculty:
Practical 5
Create Mesh, ring, bus, star and tree topology in packet tracer and assign
appropriate IP addresses to devices. Describe complete configuration
procedure.

1. Mesh Topology

Configuration Steps:
1. Add Devices:
o From the bottom left corner, select End Devices.
o Drag and drop 5 PCs onto the workspace.
o From the Switches section, add 5 Switches.

2. Connect Devices:
o Use the Connections tool (cable icon) and select Copper Straight-Through Cable.
o Connect each PC to all switches. (Full mesh: each device connects to every other
device.)

Page 14
Computer network (3150710) 230133107005

3. Assign IP Addresses:
o Click on each PC, go to the Desktop tab, then IP Configuration.
o Assign IP addresses:
▪ PC1: 192.168.1.1
▪ PC2: 192.168.1.2
▪ PC3: 192.168.1.3
▪ PC4: 192.168.1.4
▪ PC5: 192.168.1.5

4. Testing Connectivity:
o Open the Command Prompt on any PC and use the ping command to check
connectivity with other PCs.

2. Ring Topology

Configuration Steps:
1. Add Devices: o Add 5 PCs and 5 Switches.
2. Connect Devices:
o Connect the devices in a circular manner using the Copper Straight-Through
Cable. o For example: PC1 to Switch1, Switch1 to Switch2, and so on until you
connect Switch5 back to Switch1.

Page 15
Computer network (3150710) 230133107005

3. Assign IP Addresses:
o Assign IP addresses similar to:
▪ PC1: 192.168.2.1
▪ PC2: 192.168.2.2
▪ PC3: 192.168.2.3
▪ PC4: 192.168.2.4
▪ PC5: 192.168.2.5
4. Testing Connectivity:
o Use the ping command to verify connectivity.

3. Bus Topology
Configuration Steps:
1. Add Devices:
o Add 5 PCs and 5 Switch.

2. Connect Devices:
o Use Copper Straight-Through Cables to connect each PCs to the switch, then
connect all swtches in a linear manner.This represents a linear bus topology.

Page 16
Computer network (3150710) 230133107005

3. Assign IP Addresses:
o Assign IP addresses:
▪ PC1: 192.168.3.1
▪ PC2: 192.168.3.2
▪ PC3: 192.168.3.3
▪ PC4: 192.168.3.4
▪ PC5: 192.168.3.5

4. Testing Connectivity:
o Use the ping command to check if all PCs can communicate.

4. Star Topology
Configuration Steps:

1. Add Devices: o Add 5 PCs and 1 central Switch.


2. Connect Devices:
o Use Copper Straight-Through Cables to connect each PC to the central switch.

Page 17
Computer network (3150710) 230133107005

3. Assign IP Addresses:
o Assign IP addresses:
▪ PC1: 192.168.4.1
▪ PC2: 192.168.4.2
▪ PC3: 192.168.4.3
▪ PC4: 192.168.4.4
▪ PC5: 192.168.4.5
4. Testing Connectivity:
o Use the ping command to ensure connectivity.

5. Tree Topology
Configuration Steps:
1. Add Devices:
o Add 1 central Switch, 2 secondary Switches, and 6 PCs (3 connected to each
secondary switch).
2. Connect Devices:

Page 18
Computer network (3150710) 230133107005

o Connect the central switch to the two secondary switches. o Connect 3 PCs
to each secondary switch.

3. Assign IP Addresses:
o Assign IP addresses as follows:
▪ PCs on Switch 1:
▪ PC1: 192.168.5.1
▪ PC2: 192.168.5.2
▪ PC3: 192.168.5.3 ▪ PCs on Switch
2:
▪ PC4: 192.168.5.4
▪ PC5: 192.168.5.5
▪ PC6: 192.168.5.6
4. Testing Connectivity:
o Use the ping command from each PC to ensure connectivity with other PCs.

Conclusion:
In this practical, different network topologies were created in Packet Tracer, and devices were
assigned IP addresses to simulate their unique communication patterns and configurations.

Page 19
Computer network (3150710) 230133107005

Signature of Faculty:
Practical 6
Create a sub network using two switches, eight computers and connect both
sub network using router in packet tracer and assign appropriate IP addresses
to devices. Describe complete configuration procedure

Here's a step-by-step guide to configure this network:

Step 1: Setting up the Network in Packet Tracer 1.


Open Cisco Packet Tracer and start a new project.
2. Add Devices:
o Router: Drag one router from the device list.
o Switches: Drag two switches (one for each subnet).
o Computers (PCs): Drag eight computers (four for each subnet).
3. Connect Devices:
o Use copper straight-through cables to connect each PC to its respective switch.
o Connect both switches to the router. Use copper straight-through cables for
connecting switches to the router.
▪ Switch 1 (for Subnet 1) to Router GigabitEthernet 0/0.

Page 20
Computer network (3150710) 230133107005

▪ Switch 2 (for Subnet 2) to Router GigabitEthernet 0/1.

Step 2: Assign IP Addresses to Devices


1. Subnet Planning:
o Let's use the 192.168.1.0/24 network for Subnet 1.
o Use the 192.168.2.0/24 network for Subnet 2.
2. Assign IPs to PCs:
o Subnet 1 (connected to Switch 1):
▪ PC1: 192.168.1.2, Subnet mask: 255.255.255.0, Default Gateway:
192.168.1.1
▪ PC2: 192.168.1.3, Subnet mask: 255.255.255.0, Default Gateway:
192.168.1.1
▪ PC3: 192.168.1.4, Subnet mask: 255.255.255.0, Default Gateway:
192.168.1.1
▪ PC4: 192.168.1.5, Subnet mask: 255.255.255.0, Default Gateway:
192.168.1.1
o Subnet 2
(connected to Switch 2):
▪ PC5: 192.168.2.2, Subnet mask: 255.255.255.0, Default Gateway:
192.168.2.1
▪ PC6: 192.168.2.3, Subnet mask: 255.255.255.0, Default Gateway:
192.168.2.1

Page 21
Computer network (3150710) 230133107005

▪ PC7: 192.168.2.4, Subnet mask: 255.255.255.0, Default Gateway:


192.168.2.1
▪ PC8: 192.168.2.5, Subnet mask: 255.255.255.0, Default Gateway:
192.168.2.1

3. Assign IPs to Router Interfaces:


o Click on the Router, go to the Config tab or the CLI tab (whichever you're
comfortable with), and configure the interfaces.
▪ For GigabitEthernet 0/0 (connected to Subnet 1), assign the IP
192.168.1.1, Subnet mask 255.255.255.0.
▪ For GigabitEthernet 0/1 (connected to Subnet 2), assign the IP
192.168.2.1, Subnet mask 255.255.255.0.
Step 3: Configure Router Interfaces
1. Enable Interfaces:
o In the CLI tab of the router, type the following commands to configure and
enable the interfaces:
Router> enable
Router# configure terminal
Router(config)# interface GigabitEthernet 0/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)# interface GigabitEthernet 0/1


Router(config-if)# ip address 192.168.2.1 255.255.255.0

Page 22
Computer network (3150710) 230133107005

Router(config-if)# no shutdown
Router(config-if)# exit

Router(config)# exit

1. Verify Interface Status:


o Use the show ip interface brief command to verify the interfaces are up and have
the correct IP addresses.

Step 4: Set Default Gateway on PCs


1. Go to each PC:
o Open PC1 (by clicking on it), then go to the Desktop tab > IP Configuration.
Assign the IP address 192.168.1.2 and set the default gateway to 192.168.1.1. o
Repeat the same for the other PCs, ensuring they have their appropriate IPs and
default gateway.

Page 23
Computer network (3150710) 230133107005

Step 5: Test Connectivity


1. Ping Between PCs in the Same Subnet:
o From PC1, go to the Command Prompt and type ping 192.168.1.3 (IP of PC2)
to test if the devices can communicate within the same subnet.
o Similarly, test with the other PCs in the same subnet.

2. Ping Between Subnets:


o Ping from PC1 (192.168.1.2) to PC5 (192.168.2.2). Since the router is
configured, it should route the packets between the subnets.

Page 24
Computer network (3150710) 230133107005

Conclusion:
In this practical, two sub-networks were connected using a router in Packet Tracer, and
appropriate IP addresses were configured to enable inter-network communication.

Signature of Faculty:
Practical 7
Create a network topology with four host machines, local and authoritative
DNS server and web server. Describe complete configuration procedure.

Network Topology Overview Devices

Required:

1. 4 PCs (Host Machines)

2. 1 Local DNS Server (Generic Server)

3. 1 Authoritative DNS Server (Generic Server)

4. 1 Web Server (Generic Server)

5. 1 Router (to connect everything)

6. 1 Switch (to connect hosts to the network) IP Addressing Scheme:

• Subnet: 192.168.1.0/24

• Router IP: 192.168.1.1

• Local DNS Server IP: 192.168.1.2

Page 25
Computer network (3150710) 230133107005

• Authoritative DNS Server IP: 192.168.1.3

• Web Server IP: 192.168.1.4

• PCs:

o PC1: 192.168.1.10 o PC2: 192.168.1.11 o PC3:

192.168.1.12

o PC4: 192.168.1.13

To create above network topology, follow this step-by-step configuration procedure:

1. Setting Up the Topology 1. Add Devices:


o Open Cisco Packet Tracer and drag the following devices into the workspace:
▪ 1 Router (e.g., Cisco 1941).
▪ 1 Switch (e.g., Cisco 2960).
▪ 4 PCs (PC1, PC2, PC3, PC4).
▪ 1 Local DNS Server (Generic Server).
▪ 1 Authoritative DNS Server (Generic Server). ▪ 1 Web Server
(Generic Server).
2. Connect Devices:
o Use copper straight-through cables to connect:
▪ The Router to the Switch (connect from GigabitEthernet0/0 of the router
to one of the switch ports).
▪ Each PC, the Local DNS Server, the Authoritative DNS Server, and the
Web Server to the switch.

Page 26
Computer network (3150710) 230133107005

2. Configuring the Router


1. Click on the Router:
o Open the router's configuration panel and go to the CLI tab.
2. Configure the Router Interface:
o Enter the following commands to configure the interface:
Router> enable
Router# configure terminal
Router(config)# interface GigabitEthernet 0/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

Page 27
Computer network (3150710) 230133107005

3. Configuring the Local DNS Server 1. Click on the Local DNS


Server:
o Open the server's configuration panel and go to the Desktop tab.
2. Configure IP Address: o
Click on IP Configuration.
o Set the following:
▪ IP Address: 192.168.1.2
▪ Subnet Mask: 255.255.255.0
▪ Default Gateway: 192.168.1.1

3. Configure DNS Settings: o Go to the DNS tab in


the Local DNS Server.
o Add a DNS record:
▪ Name: example.local
▪ Address: 192.168.1.4 (Web Server IP)

4.

Configuring the Authoritative DNS Server


2. Click on the Authoritative DNS Server:
o Open the server's configuration panel and go to the Desktop tab.
3. Configure IP Address:
o Click on IP Configuration.

Page 28
Computer network (3150710) 230133107005

o Set the following:


▪ IP Address: 192.168.1.3
▪ Subnet Mask: 255.255.255.0 ▪ Default Gateway: 192.168.1.1
4. Configure DNS Settings:
o Go to the DNS tab in the Authoritative DNS Server.
o Add a DNS record:
▪ Name: example.com
▪ Address: 192.168.1.4 (Web Server IP)

5. Configuring the Web Server 1. Click on the Web Server: o Open the server's
configuration panel and go to the Desktop tab.
2. Configure IP Address:
o Click on IP Configuration.
o Set the following:
▪ IP Address: 192.168.1.4
▪ Subnet Mask: 255.255.255.0 ▪ Default
Gateway: 192.168.1.1
3. Configure HTTP Service:
o Go to the Services tab.
o Enable the HTTP service and make sure it is running.

6. Configuring PCs
1. Configure Each PC:
o Click on PC1 (repeat for PC2, PC3, PC4):
▪ Go to the Desktop tab.
▪ Click on IP Configuration.
▪ Set the following:
▪ PC1:
▪ IP Address: 192.168.1.10
▪ Subnet Mask: 255.255.255.0
▪ Default Gateway: 192.168.1.1
▪ DNS server: 192.168.1.2
▪ PC2:
▪ IP Address: 192.168.1.11
▪ Subnet Mask: 255.255.255.0
▪ Default Gateway: 192.168.1.1
▪ DNS server: 192.168.1.2
▪ PC3:
▪ IP Address: 192.168.1.12
▪ Subnet Mask: 255.255.255.0

Page 29
Computer network (3150710) 230133107005

▪ Default Gateway: 192.168.1.1


▪ DNS server: 192.168.1.2

▪ PC4:
▪ IP Address: 192.168.1.13
▪ Subnet Mask: 255.255.255.0
▪ Default Gateway: 192.168.1.1
▪ DNS server: 192.168.1.2

7. Testing the Configuration


1. Test Connectivity:
o Open the Command Prompt on each PC and ping the Local DNS Server
(192.168.1.2), the Web Server (192.168.1.4), and the Authoritative DNS Server
(192.168.1.3) to ensure they are reachable. o Use commands like: ping
192.168.1.2 ping 192.168.1.3 ping 192.168.1.4

3. Test DNS Resolution:


• From the PCs, you can use the browser to access the web server by typing the domain
names configured in the Local DNS Server and Authoritative DNS Server:
o For example, try accessing http://example.local or http://example.com.

Page 30
Computer network (3150710) 230133107005

Conclusion:
In this practical, a network with host machines, a local and authoritative DNS server, and a web
server was configured to resolve domain names and access websites using assigned IPs.

Signature of Faculty:

Practical 8

AIM: Implement the concept of dynamic routing

What Is Dynamic Routing?


Dynamic routing is a networking technique that provides optimal data routing.
Unlike static routing, dynamic routing enables routers to select paths according to
real-time logical network layout changes.
Dynamic routing uses multiple algorithms and protocols. The most popular are
Routing Information Protocol (RIP) and Open Shortest Path First (OSPF).
Dynamic routing protocols allow routers to share information about the network
with other routers to allow them to select the best path to reach a destination

Page 31
Computer network (3150710) 230133107005

Steps To Implement RIP Routing Protocol:

1) Prepare topology as shown in below figure.

 The network PC is connected to the switch with Copper-Straight through


Cable.

 Each Switch is connected to the router using Copper-Straight through Cable.

 And to connect two routers with each other add Serial ports to the router for
that turn off the router Select WIC-2T and add it to the router and turn on the
router.

 Two routers are connected using serial DTE cable.

Network using two switch and two routers

2) Set the IP Address of the each PC with respect to network address for example
here PC0 is in the 192.168.1.0 network so the IP address of PC0 is 192.168.1.1.

Page 32
Computer network (3150710) 230133107005

Setting up IP address for PC0

3) Once the IP address of each PC is set, set the IP address of the fast Ethernet port of
router to which switch is connected. And then turn on the port. Follow the same
process for second (Router 1) router.

Page 33
Computer network (3150710) 230133107005

Setting up connection with fast Ethernet port for Router0

Setting up connection with fast Ethernet port for Router1


4) Set the IP address serial port of all routers.

Page 34
Computer network (3150710) 230133107005

Setting up IP address serial port for Router0

Setting up IP address serial port for Router1

5) Add number of network in RIP routing.

Page 35
Computer network (3150710) 230133107005

 To add number of network - open the settings of router head to the RIP
category. And in there add the network address of another network to which
we want to connect our router.
 For example in above image if we want to access network 192.168.1.0 add
that network address in network.
 Follow the same process for Router 1. And with this our routing is
completed.

Network using two switch and two routers

Adding network to RIP


6) Test the network. - Transfer the data packet from one network pc to other network
pc.

Page 36
Computer network (3150710) 230133107005

Transferring the data packet from one network pc to other network pc

2) OSPF Routing Protocol:

 Open Shortest Path First is the dynamic routing protocol used in large to
very large IP networks.

o Steps To Implement OSPF Routing Protocol:


1) Add Network Devices in Network As Following:

 Here in the network PC is connected to the switch with Copper-Straight


through Cable. Each Switch is connected to the router using Copper-Straight
through Cable.

 To connect two routers with each other we have to add Serial ports to the
router for that turn off the router Select WIC-2T and add it to the router and
turn on the router.

 Three routers are connected using serial DTE cable.

Page 37
Computer network (3150710) 230133107005

Network using two switch and two routers through OSPF

2) Set the IP Address of the each PC with respect to network address for example
here PC0 is in the 192.168.1.0 network so the IP address of PC0 is 192.168.1.1.

Setting up the IP Address

3) Once the IP address of each PC is set, set the IP address of the fast Ethernet port
of router to which switch is connected. And then turn on the port. Follow the same
process for second (Router 1) router.

Page 38
Computer network (3150710) 230133107005

Setting up connection with fast Ethernet port for Router0

Setting up connection with fast Ethernet port for Router1

Page 39
Computer network (3150710) 230133107005

4) Now we will have to set the IP address serial port of all routers.

Setting up connection with fast Ethernet port for Router0

Setting up connection with fast Ethernet port for Router1

Page 40
Computer network (3150710) 230133107005

Setting up connection with fast Ethernet port for Router2

5) Our network is ready only one thing is left to do which is to add number of
network through OSPF Command.

Setting up connection with Router0 through OSPF

Page 41
Computer network (3150710) 230133107005

Setting up connection with Router1 through OSPF

Page 42
Computer network (3150710) 230133107005

6) Test the network. Transfer the data packet from one network pc to other
network pc.

Testing the network

Conclusion:
In this practical, we see Dynamic routing is a networking technique that provides optimal data
routing.

Signature of Faculty:

Page 43
Computer network (3150710) 230133107005

Practical 9
Aim: Implement the concept of VLAN using Network Simulator

What is VLAN?
Virtual Local Area Networks or Virtual LANs (VLANs) are a logical group of
computers that appear to be on the same LAN irrespective of the configuration of
the underlying physical network.

Steps to Implement a Virtual Local Area Network (VLAN):


1) Take a switch and 4 end devices (PCs), and connect the switch with end
devices using Copper Straight-Through cable. While connecting the cables it
is needed to select the port through which you want to connect the switch to
the end devices.

Configuring VLAN in simulator.


 As in the above images to connect switch to PC0 choose
‘FastEthernet0/1’ port in the switch and then in PC0 is selected
‘FastEthernet0’ port. Similarly, connect the entire PC with the switch.

2) Now, to configure two VLANs in which take 2 PC for each VLAN. Separate 2
PCs for each VLAN which are numbered as VLAN 2 and VLAN 3. We
cannot use VLAN 1 because it default VLAN used by the switch. Let us
assume that the VLAN 2 is being used by the Sales Department of the

Page 44
Computer network (3150710) 230133107005

organization and VLAN 3 being used by the HR Department of the


organization

3) Provide the IP addresses and gateways to the end devices as shown in the
below image.

Providing IP address and gateways to end devices.

Providing IP addresses to VLANs

Page 45
Computer network (3150710) 230133107005

4) Configure the VLAN


click on the switch -> go to CLI and press “Enter” then write the following
commands to configure the VLANs and provide the names to VLANs.

 Commands:

 en/enable: Logs you into enable mode, which is also known as user
exec mode or privileged mode.
 confi/configure terminal: Logs you into configuration mode.
 vlan number(except 1): Creates a VLAN and enters VLAN
configuration mode for further definitions of specified number of
the VLAN.
 name vlan_name: Provides the specified name to the VLAN chosen
by the vlan number command. To provide name to VLAN 2 we
have to write name Sales after vlan 2 command. To provide name to
VLAN 3 we have to write name HR after vlan 3 command.
 exit: Exits from VLAN configuration mode.

Providing specific name to VLANs

Page 46
Computer network (3150710) 230133107005

5) Now, both the VLANs have been configured. To verify whether the VLANs
have been activated or not we have to write “show vlan” command. And after
pressing Enter we can see both the created VLANs as shown in the below
image.

VLANs activation status.

Here we can see in the above image that both the VLANs (VLAN 2 & VLAN3)
which are “Sales” & “HR” are successfully configured and are active.

6) Now, to make the VLANs work properly we have to assign the devices
among the manually configured host which are “VLAN 2(Sales)” & “VLAN
3(HR)”.

 To assign devices among the VLANs we have to write series of


commands which are:

1. confi/configure terminal: Logs you into configuration mode.


2. interface: Enters interface configuration mode for the specified fast
ethernet interface
3. switchport access vlan: Sets the VLAN that the interface belongs to.
It means it assigns the previously specified interface using interface
command to work in the specific VLAN only if the device from the
other VLAN tries to communicate with the specific interface it will
not be successful.

Page 47
Computer network (3150710) 230133107005

Configuring interface to VLANs

Now we can see in the below image that if we send the message to the device in
the same VLAN then the message is sent successfully, but if we send the message
to the device in the different VLAN it cannot be sent to successfully.

Sending message to different VLAN


Now to check whether the message can be sent to the device in another VLAN we
will click the PC from which we have to send the message and then click
“Desktop” and then go to “Command Prompt” and then give command “ping IP
address” here the IP address in the command specifies the destination device’s IP
address

Page 48
Computer network (3150710) 230133107005

Sending message to same VLAN

As we can see in the above image if we ping to the device from another VLAN it
will not give reply as it is in the other VLAN. But if we ping to the device which is
in the same VLAN as the sender is then the message will be successfully sent.
Now to check whether the message can be sent to the device in another VLAN we
will
click the PC from which we have to send the message and then click “Desktop”
and then
go to “Command Prompt” and then give command “ping IP address” here the IP
address
in the command specifies the destination device’s IP address

Conclusion:
In this practical, we see the concept of VLAN using Network Simulator.

Page 49
Computer network (3150710) 230133107005

Signature of Faculty:

Page 50
Computer network (3150710) 230133107005

Practical 10

AIM: Packet capture and header analysis by wire-shark (TCP, UDP, IP).

What is wireshark?
 Wireshark is an open-source packet analyzer, which is used for education, analysis,
software development, communication protocol development, and network
troubleshooting.
How to capture Packet in Wireshark?
 Connect to Router from which you want to capture packet.
 Next step is to launch wireshark in your pc.
 Click on capture to start capturing the packets with optional filter option.

Wireshark Network Analyzer

Capture Different Types of packets and analyze them:

Page 51
Computer network (3150710) 230133107005

1) TCP Packets:

Capturing TCP packet from Wireless Network

2) UDP Packets:

UDP packet from Wireless Network


Conclusion:
In this practical, we see the concept of wire-shark

Signature of Faculty:

Page 52

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy