CN 13
CN 13
Coputer Networks(3150710)
B.E. Semester 5
Computer Engineering
Page 1
Computer network (3150710) 230133107005
Certificate
__________
Page 2
Computer network (3150710) 230133107005
Index
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
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.
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.
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;
while (true) {
Page 9
Computer network (3150710) 230133107005
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.net.Socket;
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:
Page 11
Computer network (3150710) 230133107005
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.");
}
}
Page 12
Computer network (3150710) 230133107005
writer.println(message);
}
}
}
}
}
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:
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
Page 20
Computer network (3150710) 230133107005
Page 21
Computer network (3150710) 230133107005
Page 22
Computer network (3150710) 230133107005
Router(config-if)# no shutdown
Router(config-if)# exit
Router(config)# exit
Page 23
Computer network (3150710) 230133107005
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.
Required:
• Subnet: 192.168.1.0/24
Page 25
Computer network (3150710) 230133107005
• PCs:
192.168.1.12
o PC4: 192.168.1.13
Page 26
Computer network (3150710) 230133107005
Page 27
Computer network (3150710) 230133107005
4.
Page 28
Computer network (3150710) 230133107005
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
▪ 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
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
Page 31
Computer network (3150710) 230133107005
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.
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
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
Page 34
Computer network (3150710) 230133107005
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.
Page 36
Computer network (3150710) 230133107005
Open Shortest Path First is the dynamic routing protocol used in large to
very large IP networks.
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.
Page 37
Computer network (3150710) 230133107005
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.
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
Page 39
Computer network (3150710) 230133107005
4) Now we will have to set the IP address serial port of all routers.
Page 40
Computer network (3150710) 230133107005
5) Our network is ready only one thing is left to do which is to add number of
network through OSPF Command.
Page 41
Computer network (3150710) 230133107005
Page 42
Computer network (3150710) 230133107005
6) Test the network. Transfer the data packet from one network pc to other
network pc.
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.
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
3) Provide the IP addresses and gateways to the end devices as shown in the
below image.
Page 45
Computer network (3150710) 230133107005
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.
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.
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)”.
Page 47
Computer network (3150710) 230133107005
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.
Page 48
Computer network (3150710) 230133107005
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.
Page 51
Computer network (3150710) 230133107005
1) TCP Packets:
2) UDP Packets:
Signature of Faculty:
Page 52