CN Lab File Lab File
CN Lab File Lab File
2
3 lOMoARcPSD|50682290
2 Experiment No. 1
3 1. Study of different network devices (Hub, Switch, Router, and Gateway) in detail.
4 Objective:
5 To study different network devices (Hub, Switch, Router, and Gateway) in detail.
6
7 Resource Requirement:
8 H/W Requirements: Network devices such as hubs, switches, routers, and gateways for hands-on learning,
9 network cables to connect the device.
10 S/W Requirements: Cisco Packet Tracer.
11
12 Theory:
13 Hub:
14 A hub is a basic networking device that connects multiple devices in a network. It operates on the physical
15 layer of the OSI model and is responsible for simply repeating any incoming signal it receives to all the other
16 devices connected to it, regardless of whether the intended recipient is present. Hubs are now outdated and
17 have been largely replaced by switches. This is because hubs are prone to collisions, which can cause
18 significant network congestion.
19
20
21
22 Figure 1.1: Hub
23
24 Switch:
25 A switch is a networking device that operates on the data link layer of the OSI model. It is designed to connect
26 multiple devices in a network and selectively forward data packets to their intended destinations based on the
27 MAC addresses of the devices. Switches provide a more efficient and secure way of transferring data
28 compared to hubs. This is because switches create a dedicated path between the source and destination devices,
29 reducing network congestion and preventing data collisions.
30
31
32
33
34 Figure 1.2: Switch
35
36
37 Router:
38 A router is a networking device that operates on the network layer of the OSI model. It is responsible for
39 forwarding data packets between different networks or subnets based on the IP addresses of the devices.
40 Routers can connect different types of networks, including LANs, WANs, and the internet. They can also
41 perform functions such as network address translation (NAT) and firewalling, which help to protect the
42 network from unauthorized access and attacks.
4
5 lOMoARcPSD|50682290
43
44 Figure 1.3: Router
45
46
47 Gateway:
48 A gateway is a networking device that serves as the entry or exit point for a network. It can connect different
49 types of networks that use different communication protocols, allowing them to communicate with each other.
50 For example, a gateway can connect a LAN to the internet, translating between the protocols used by the LAN
51 and the internet. Gateways can also perform functions such as routing, filtering, and protocol conversion.
52
53
54 Figure 1.4: Gateway
55
56 Conclusion:
57 In conclusion, studying different network devices such as hubs, switches, routers, and gateways is critical for
58 building and maintaining effective network.
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
6 2
7
8
9 lOMoARcPSD|50682290
77 Experiment No. 2
78
79 2. Study of handling and configuration of networking hardware like RJ-45 connector, CAT-6 cable, crimping tool,
80 and LAN tester.
81
82 Objective:
83 To study handling and configuration of networking hardware like RJ-45 connector, CAT-6 cable, crimping tool, and
84 LAN tester.
85
86 Resource Requirement:
87 H/W Requirements: RJ45, CAT cables, Crimping Tool, Printer, and Internet
88 Connection.
89
90 S/W Requirements: Cisco Packet Tracer.
91
92 Theory:
93 RJ-45 connector:
94 RJ45 cable is used for connecting the ALL HMI and engineer station through a switch to communicate with each
95 other. It is used to download the any modification, and which is made in graphics in engineering station. RJ45 cable
96 is also used for communicating the printer with computer. There are four pairs of wires in an Ethernet cable, and an
97 Ethernet connector (8P8C) has eight pin slots. Each pin is identified by a number, starting from left to right, with the
98 clip facing away from you.
99
100
101
102
103
104 Figure 2.1: RJ-45 Connector Pin Out
105
106
107 There are two kinds of Ethernet cable used for communication.
108 • Straight Through
109 • Crossover cable
110
111 Straight Through Cable:
112 Straight Through Ethernet cables are the standard cable used for almost all purposes and are often called “patch
113 cables”. It is highly recommended you duplicate the color order as shown on the left. Note how the green pair is not
114 side-by- side as are all the other pairs. This configuration allows for longer wire runs.
10
11 lOMoARcPSD|50682290
115 Figure
123
124 Figure 2.3: Crossover Cable
125
126 CAT Cables:
127 The Cat, as you might know, is short for "Category." The term "Category" refers to the different levels of
128 performance in signal bandwidth, attenuation and crosstalk associated with each cable's design.
129 Category 1 cables are a 2-pair copper UTP designed for POTS (plain old telephone systems). CAT 5e is currently the
130 most used cable, mainly due to its low production cost and support for speeds faster than Cat 5 cables.
12 4
13
14
15 lOMoARcPSD|50682290
131
132 A Cat6 cable has a bandwidth capacity of 250 MHz, for example, and it offers you speeds of up to 10 Gbps. It's also
133 compatible with both Cat5 and Cat5E cables. “A Cat6 cable is used mainly for computer networks reaching a GB,
134 1000 Mbps or one Gbps of data transfer speed (DTR) or higher,”.
135
136
137 Figure 2.4: Different CAT cables
138
139 Crimping Tool:
140 Crimpers are tools used to make cold weld joints between two wires or a wire and a connector, such as lugs. Ideally,
141 the electrical and mechanical properties of the weld joint are as strong as the parent materials. Crimping tools are
142 sized according to the wire gauges (using AWG - American Wire Gauge) they can accept. Some come with
143 interchangeable die heads that allow for a wider range of wire sizes and connectors.
144
145 How to use:
146 First you will need to strip the length of wire that you want to crimp. Then, attach the connector. For crimping tools
147 with interchangeable dies, you will need to select the right die head for the connector by matching wire gauge ratings.
148 For die less crimpers, you will need to match to the proper groove. Finally, apply pressure, take out the newly
149 crimped connector, and give a few tugs to make sure you have a solid and secure connection.
150
151
152 Figure 2.5: Crimping Tool
153
154 LAN tester:
155 A LAN tester is an essential tool for any computer network lab to ensure that the LAN is functioning correctly and to
156 troubleshoot any problems that may arise.
16
17 lOMoARcPSD|50682290
157
158 Figure 2.6: LAN Tester
159
160 Conclusion:
161 Hence, we have implemented RJ45 and CAT cabling and connections using a crimping tool, and we have tested this
162 using a LAN tester.
18 6
19
20
21 lOMoARcPSD|50682290
185
186 Figure 3.1: Creating a new project.
194
195
196 Figure 3.2: Virtual Switch
197 Step 4: Connect 10 computers to the switch using Ethernet cables.
22
23 lOMoARcPSD|50682290
198 To connect 10 computers to the switch using Ethernet cables, click on the "Devices" menu and select "Add > PC". In
199 the "Add PC" dialog box, select the type of PC you want to add and click on the "Add" button. Repeat this step 9
200 more times to add 10 PCs to the project.
201 Once you have added 10 PCs to the project, connect each PC to the switch using an Ethernet cable. To do this, drag
202 the Ethernet cable from the PC to the switch port.
203
204
205
206
207 Figure 3.3: Connection to switch using Ethernet cables.
208
209 Step 5: Configure the IP addresses of the computers.
210 To configure the IP addresses of the computers, click on the "Config" tab of the PC's properties window. In the "IP
211 Address" field, enter the IP address of the PC. In the "Subnet Mask" field, enter the subnet mask for the network.
212 Repeat this step for all 10 PCs.
213
214
215 Figure 3.4: IP Configuration
216
217 Step 6: Test the connectivity between the computers by pinging each computer from another computer.
218 To test the connectivity between the computers, open a command prompt on one of the computers. In the command
219 prompt, type "ping" followed by the IP address of another computer. If the computer is reachable, you will see a
220 response message. Repeat this step for all 10 computers.
24 8
25
26
27 lOMoARcPSD|50682290
221
222
223 Figure 3.5: Testing Connectivity
224 Finally, we should now have a LAN with 10 computers connected to a switch using star topology in Cisco Packet
225 Tracer. We can verify this by opening the Topology window, where we should see all 10 computers connected to the
226 switch.
227
228 Conclusion:
229 In conclusion, the experiment was a success. The 10 computers were successfully connected to the switch using star
230 topology in Cisco Packet Tracer. The connectivity between the computers was also verified by pinging each
231 computer from another computer.
232
233 This experiment has demonstrated that star topology is a reliable and efficient way to connect computers in a LAN. It
234 is also a very scalable topology, as it can be easily expanded by adding more computers.
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
28
29 lOMoARcPSD|50682290
279
280 Figure 4.1: Virtual Switches
281
282
283 Step 2: Assign IP addresses to the PCs.
284 o Drag and drop two PCs for each switch onto the workspace.
285 o Double-click on each PC and assign IP addresses, subnet masks, and default gateways to the network
286 interfaces of the PCs.
287
288
289
290 Figure 4.2: Assigning IP
291
292
293 Step 3: Establish connections between the two switches using a router.
294 o Drag and drop a router onto the workspace.
295 o Connect the LAN-1 switch's interface (e.g., GigabitEthernet0/1) to one of the router's interfaces (e.g.,
296 GigabitEthernet0/0).
297 o Connect the LAN-2 switch's interface (e.g., GigabitEthernet0/1) to another interface on the router (e.g.,
298 GigabitEthernet0/1).
299
30 10
31
32
33 lOMoARcPSD|50682290
300
301 Figure 4.3: Establishing connection using Router.
302
303 Step 4: Configure the router.
304 Double-click on the router to open the configuration dialog box.
305 Click on the "CLI" (Command Line Interface) tab to access the router's command line interface.
306
307 Step 5: Configure the router interfaces.
308 Enter the following commands to configure the interfaces of the router:
309
310 Router> enable
311 Router# configure terminal
312 Router(config)# interface GigabitEthernet0/0
313 Router(config-if)# ip address 10.10.10.3 255.0.0.0
314 Router(config-if)# no shutdown
315 Router(config-if)# exit
316 Router(config)# interface GigabitEthernet0/1
317 Router(config-if)# ip address 192.168.1.3 255.255.255.0
318 Router(config-if)# no shutdown
319 Router(config-if)# exit
320 Router(config)# exit
321
34
35 lOMoARcPSD|50682290
338
339 The pings are successful, it means that the two LANs are connected via the router.
340
341 Conclusion:
342 We have successfully designed a network with two LANs connected via a router using Cisco Packet Tracer and tested
343 the connectivity between the PCs.
36 12
37
38
39 lOMoARcPSD|50682290
346 5. Design a network having three LAN and each LAN connected to a Router. Each Router is connected to each
347 other using Serial connection. Configure the Router using command line interface of Packet Tracer?
348
349 Objective:
350 To design a network consisting of three LANs, with each LAN connected to a router, and to establish connectivity
351 between the LANs by interconnecting the routers using serial connections.
352
353 Apparatus Requirement:
354 Cisco Packet Tracer software, Switches, PCs, Ethernet cables.
355
356 Procedure:
357 Step 1: Launch Cisco Packet Tracer
358 Start by launching Cisco Packet Tracer on your computer.
359
360 Step 2: Add Devices
361 Click on the "Devices" tab located on the left sidebar. Drag and drop the following devices onto the workspace:
362 o 3 PCs (for the LANs) o 3 Routers
363
364
365
366 Figure 5.1: Adding PCs and Routers
367
368 Step 3: Connect Devices
369 To connect the devices, select the "Connections" tab from the left sidebar. Choose the appropriate cable type and
370 connect the devices as follows:
371 o Connect each LAN to its respective router using
372 Copper Straight-through cables. o Connect the routers to
373 each other using Serial DCE/DTE cables.
374
40
41 lOMoARcPSD|50682290
375
376 Figure 5.2: Connecting the devices.
377
378
42 14
43
44
45 lOMoARcPSD|50682290
418 Router 3:
419 Router>enable
420 Router#configure terminal
421 Router(config)#interface FastEthernet0/0
422 Router(config-if)#ip address 192.168.3.3 255.255.255.0
423 Router(config-if)#no shutdown
424 Router(config-if)#exit
425 Router(config)#interface Serial0/0/0
426 Router(config-if)#ip address 192.168.5.2 255.255.255.0
427 Router(config-if)#no shutdown
428 Router(config-if)#exit
46
47 lOMoARcPSD|50682290
471 Objective:
472 To design and implement a wireless LAN using CISCO Packet Tracer.
473
474 Apparatus Requirement:
475 Cisco Packet Tracer (Software), Wireless router (e.g., CISCO 1841), Wireless access points (e.g., CISCO Aironet
476 3700 series), Ethernet Cables, Wireless devices (e.g., laptops, smartphones).
477
478 Procedure:
479 The Step-by-Step Process are:
480 Step 1: Launch CISCO Packet Tracer software on your computer.
481 Step 2: Create a new project and select the appropriate workspace.
482 Step 3: Drag and drop a wireless router from the device panel onto the workspace.
483 Step 4: Connect the laptops to the wireless router using wireless connections.
484 Step 5: Configure the basic parameters of the router, including hostname, IP address, and subnet mask.
485 Step 6: Double-click on each Laptop to open the configuration dialog box. Set the IP address and subnet mask for
486 each Laptop’s network interface in their respective LANs.
487
488
489
490 Figure 6.1: Wireless LAN Connection
491
492
493
494 Step 7: Verify that the laptops are able to connect to the wireless network.
495
48 16
49
50
51 lOMoARcPSD|50682290
499 Result:
500 We will have successfully designed a wireless LAN using Cisco Packet Tracer.
501
502 Conclusion:
503 The experiment was successful in that the laptops were able to connect to the wireless network and access the
504 internet.
52
53 lOMoARcPSD|50682290
int main() {
// Create a UDP socket.
int sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd <
0) { cout << "Error creating socket: " << strerror(errno)
<< endl; return 1;
}
return 0;
}
54 18
55
56
57 lOMoARcPSD|50682290
516 Result:
517 We were able to successfully implement a UDP Datagram socket in C++. We were able to create a socket, bind it to
518 a port, receive a message from a client, and send a message back to the client. We also tested our code thoroughly to
519 make sure it worked correctly.
520
521 Conclusion:
522 We implemented a UDP Datagram socket in C++. We were able to create a socket, bind it to a port, receive a
523 message from a client, and send a message back to the client. We also tested our code thoroughly to make sure
524 it worked correctly.
58
59 lOMoARcPSD|50682290
int main() {
// Create a TCP socket. int sockfd = socket(AF_INET,
SOCK_STREAM, 0); if (sockfd < 0) { cout << "Error
creating socket: " << strerror(errno) << endl; return 1;
}
// Accept a connection.
int clientfd = accept(sockfd, NULL, NULL); if (clientfd < 0)
{ cout << "Error accepting connection: " << strerror(errno)
<< endl; return 1;
}
62
63 lOMoARcPSD|50682290
538 Client:
539
#include <iostream>
#include <sys/socket.h>
#include
<netinet/in.h>
#include
<arpa/inet.h> using
namespace std;
int main() {
// Create a TCP socket. int sockfd = socket(AF_INET,
SOCK_STREAM, 0); if (sockfd < 0) { cout << "Error
creating socket: " << strerror(errno) << endl; return 1;
}
return 0;
}
64
65 lOMoARcPSD|50682290
540 To run the program, compile the server and client programs separately. Then, run the server program first, followed
541 by the client program. The client program will send a message to the server, and the server program will send a
542 message back to the client.
543
544 Result:
545 We were able to successfully create a TCP Client and Server in C++.
546
547 Conclusion:
548 We learned how to create TCP sockets in C++, how to bind sockets to ports, how to listen for connections, how to
549 accept connections, how to receive messages, how to send messages, and how to close sockets.
66 22
67
68
69 lOMoARcPSD|50682290
int main() {
// Create a UDP socket. int sockfd = socket(AF_INET,
SOCK_DGRAM, 0); if (sockfd < 0) { cout << "Error creating
socket: " << strerror(errno) << endl; return 1;
}
return 0;
}
562 Client:
70
71 lOMoARcPSD|50682290
563
#include <iostream>
#include <sys/socket.h>
#include
<netinet/in.h>
#include
<arpa/inet.h> using
namespace std;
int main() {
// Create a UDP socket. int sockfd = socket(AF_INET,
SOCK_DGRAM, 0); if (sockfd < 0) { cout << "Error creating
socket: " << strerror(errno) << endl; return 1;
}
565 To run the program, compile the server and client programs separately. Then, run the server program first, followed
566 by the client program. The client program will send a message to the server, and the server program will send a
567 message back to the client.
568
569 Result:
570 we were able to successfully create a UDP Client and Server in C++. The client and server programs were able to
571 send and receive messages to each other.
572
573 Conclusion:
574 We learned how to create UDP sockets in C++, how to bind sockets to ports, how to receive messages, how to send
575 messages, and how to close sockets. We also learned how to use UDP sockets to create a simple chat application.
576
577
578
72 24
73
74
75 lOMoARcPSD|50682290
int main() {
// Create a UDP socket.
int sockfd = socket(AF_INET, SOCK_DGRAM, 0); if (sockfd <
0) { cout << "Error creating socket: " << strerror(errno)
<< endl; return 1;
}
76
77 lOMoARcPSD|50682290
cout << "Error receiving message: " << strerror(errno) << endl;
return 1;
}
// Print the TRACEROUTE response. cout << "Received TRACEROUTE response from: "
<< buffer << " with TTL: " << ttl << endl;
ttl++;
}
590
591 Result:
592 We were able to successfully create a program that simulates the PING and TRACEROUTE commands. The
593 program was able to send and receive PING and TRACEROUTE messages, and it was able to print the results of the
594 PING and TRACEROUTE commands.
595
596 Conclusion:
597 We learned how to create a program that simulates the PING and TRACEROUTE commands in C++. We also
598 learned how to use the PING and TRACEROUTE commands to troubleshoot network problems.
78 26
79
80