R.M.K. COLLEGE OF ENGINEERING AND TECHNOLOGY (An Autonomous Institution) R.S.M. Nagar, PUDUVOYAL-601 206 Approved by AICTE, New Delhi /Affiliated to Anna University, Chennai Accredited by NBA, New Delhi (All Eligible Courses)/ NAAC with ‘ A ’ Grade An ISO 21001:2018 Certified Institution DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (CYBER SECURITY) LAB MANUAL 24CS401 – COMPUTER NETWORKS (LAB INTEGRATED) Academic Year : 2025-2026 Regulations : 2024 Batch : 2024-2028 Year / Semester : II/ IV 1 R.M.K. COLLEGE OF ENGINEERING AND TECHNOLOGY (An Autonomous Institution) R.S.M. Nagar, PUDUVOYAL-601 206 Approved by AICTE, New Delhi /Affiliated to Anna University, Chennai Accredited by NBA, New Delhi (All Eligible Courses)/ NAAC with ‘ A ’ Grade An ISO 21001:2018 Certified Institution DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (CYBER SECURITY) LAB MANUAL 24CS401 – COMPUTER NETWORKS (LAB INTEGRATED) Academic Year : 2025-2026 Regulations : 2024 Batch : 2024-2028 Year / Semester : II/ IV Prepared by Dr.Dharini N Associate Professor /CSE(CS) Checked by Dr. S. M. Udhaya Sankar Professor & Head / CSE ( CS ) Approved By Dr.N.Suresh Kumar, Principal 2 R.M.K. COLLEGE OF ENGINEERING AND TECHNOLOGY (An Autonomous Institution) R.S.M. Nagar, PUDUVOYAL-601 206 Approved by AICTE, New Delhi /Affiliated to Anna University, Chennai Accredited by NBA, New Delhi (All Eligible Courses)/ NAAC with ‘ A ’ Grade An ISO 21001:2018 Certified Institution Institute Vision and Mission Vision To be a globally recognized technological Institution fostering excellence in academics, research, and entrepreneurship, producing socially responsible engineers to meet evolving technological changes leading to the sustainable development of the nation and the world. Mission ● To impart quality technical education through outcome-based learning and modern teaching practices ● To promote research, innovation, and entrepreneurship through strong industry interaction and incubation initiatives ● To enhance employability and promote sustainability through continuous skill development and responsible social engagement. 3 R.M.K. COLLEGE OF ENGINEERING AND TECHNOLOGY (An Autonomous Institution) R.S.M. Nagar, PUDUVOYAL-601 206 Approved by AICTE, New Delhi /Affiliated to Anna University, Chennai Accredited by NBA, New Delhi (All Eligible Courses)/ NAAC with ‘ A ’ Grade An ISO 21001:2018 Certified Institution DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (CYBER SECURITY) Vision To excel and take the lead in Cyber Security education, profession and research globally with a commitment to effectively address societal needs Mission • To collaborate with innovators to provide real-world, standards- based Cyber Security capabilities that address business needs • To prepare the professionals in both academic and industrial settings capable of solving real-world Cyber Security threats • To inculcate in students the knowledge of designing and developing various projects in different areas of Cyber Security by providing a distinguished and high-quality education 4 R.M.K. COLLEGE OF ENGINEERING AND TECHNOLOGY (An Autonomous Institution) R.S.M. Nagar, PUDUVOYAL-601 206 Approved by AICTE, New Delhi /Affiliated to Anna University, Chennai Accredited by NBA, New Delhi (All Eligible Courses)/ NAAC with ‘ A ’ Grade An ISO 21001:2018 Certified Institution DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING (CYBER SECURITY) Programme Educational Objectives (PEOs) Graduates of Computer Science and Engineering(Cyber Security) Program will 1. Acquire the knowledge, skills and attitude necessary for effective Cyber Security analysis. 2. Apply the cutting-edge latest technology within a professional, legal and ethical framework to operate effectively in a multidisciplinary stream. 3. Practise continued self-learning to keep their knowledge and skills up to date and to remain abreast of the latest developments in Cyber Security. Program Specific Outcomes (PSOs) Graduates of Computer Science and Engineering (Cyber Security) Program will be able to: • Understand, analyze, design, and develop computing solutions by applying algorithms, web design, database management, and networking concepts in the field of Cyber Security. • Develop Cyber Security skills including network defense, ethical hacking, penetration testing, application security and cryptography to provide real time solutions. • Apply standard tools, practices and strategies in Cyber Security for successful career and entrepreneurship. 5 R.M.K. COLLEGE OF ENGINEERING AND TECHNOLOGY (An Autonomous Institution) R.S.M. Nagar, PUDUVOYAL-601 206 Approved by AICTE, New Delhi /Affiliated to Anna University, Chennai Accredited by NBA, New Delhi (All Eligible Courses)/ NAAC with ‘ A ’ Grade An ISO 21001:2018 Certified Institution 24CS401 COMPUTER NETWORKS (Lab Integrated) L T P C 3 0 2 4 OBJECTIVES: The Course will enable learners to: ● Study the fundamental concepts of computer networks and physical layer. ● Apply the knowledge of various protocols and techniques used in the data link layer. ● Implement the services of network layer and network layer protocols. ● Illustrate different protocols used in the transport layer. ● Build applications using the application layer protocols. UNIT I INTRODUCTION AND PHYSICAL LAYER 9+6 Data Communications – Network Types – Protocol Layering – Network Models (OSI, TCP/IP) Networking Devices: Hubs, Bridges, Switches – Performance Metrics – Transmission media - Guided media -Unguided media- Switching-Circuit Switching - Packet Switching. List of Exercise/Experiments: 1. Learn to use commands like tcpdump, netstat, ifconfig, nslookup and traceroute. 2. Capture ping and trace route PDUs using a network protocol analyzer and examine. UNIT II DATA LINK LAYER 9+6 Introduction – Link-Layer Addressing- Error Detection and Correction - Wired LANs: Ethernet - Wireless LANs – Introduction – IEEE 802.11, Bluetooth List of Exercise/Experiments: 1. Simulation of an error correction code (like CRC). 2. Simulation of Flow control mechanisms. UNIT III NETWORK LAYER 9+6 Network Layer Services – IPV4 Addresses – Forwarding of IP Packets - Network Layer Protocols: IP, ICMP v4 – Unicast Routing Algorithms – Protocols – Multicasting Basics – IPV6 Addressing – IPV6 Protocol. List of Exercise/Experiments: 1. Simulation of DNS using UDP sockets 2. Implementation of HTTP, Web Caching, FTP using socket programming. UNIT IV TRANSPORT LAYER 9+6 Introduction – Transport Layer Protocols – Services – Port Numbers – User Datagram Protocol – Transmission Control Protocol – SCTP. List of Exercise/Experiments: 1. Develop a DNS client server to resolve the given host name or IP address. 2. Simulation of unicast routing protocols UNIT V APPLICATION LAYER 9+6 Application layer-WWW and HTTP – FTP – Email – Telnet – SSH – DNS – SNMP List of Exercise/Experiments: 1. Observing Packets across the network and Performance Analysis of various Routing protocols. 2. Simulation of Trans p ort la y er Protocols and anal y sis of con g estion control techni q ues in the network. 6 TOTAL: 45 +30 = 75 PERIODS OUTCOMES: Upon completion of the course, the students will be able to: CO1: Understand the fundamental concepts of computer networks. CO2: Apply the various routing protocols to solve real-world problems. CO3: Build simple applications to solve societal problems. CO4: Apply the simulation tools to implement various protocols used in the various layers. CO5: Analyze the various application layer protocols. CO6: Apply the mathematical knowledge to do performance analysis of various routing protocols. TEXT BOOK: 1. Data Communications and Networking, Behrouz A. Forouzan, McGraw Hill Education, 5th Ed., 2017. REFERENCES: 1. Computer Networking- A Top Down Approach, James F. Kurose, University of Massachusetts and Amherst Keith Ross, 8th Edition, 2021. 2. Computer Networks, Andrew S. Tanenbaum, Sixth Edition, Pearson, 2021. 3. Data Communications and Computer Networks, P.C. Gupta, Prentice-Hall of India, 2006. 4. Computer Networks: A Systems Approach, L. L. Peterson and B. S. Davie, Morgan Kaufmann, 3rd ed., 2003. LIST OF EQUIPMENTS: C/Java, Ubuntu OS, NS2 simulation tool 7 Course Articulation Matrix Course Code/ Course Name: 24CS401/ Computer Networks Course Outcome – Programme Outcome Mapping: Course Outcome s (COs) Programme Outcomes (POs), Programme Specific Outcomes (PSOs) PO1 PO 2 PO3 PO4 PO5 PO6 PO7 PO8 PO9 PO10 PO11 PSO1 PSO2 PSO 3 CO1 3 2 - - 1 - - - - - 1 3 1 1 CO2 3 3 2 1 2 1 - - - - 1 3 2 1 CO3 2 2 3 1 2 2 1 2 2 1 1 2 1 1 CO4 2 2 1 2 3 - - 1 1 - 1 2 2 3 CO5 2 3 1 2 2 1 1 - 1 - 1 3 2 1 CO6 3 3 - 3 2 - - - 1 - 1 2 2 1 COURSE OUTCOMES CO1 Understand the fundamental concepts of computer networks. CO2 Apply the various routing protocols to solve real-world problems. CO3 Build simple applications to solve societal problems. CO4 Apply the simulation tools to implement various protocols used in the various layers. CO5 Analyze the various application layer protocols. CO6 Apply the mathematical knowledge to do performance analysis of various routing protocols. 8 EXPERIMENTS WITH MAPPED CO S.NO NAME OF THE EXERCISE Mapped CO 1 Learn to use commands like tcpdump, netstat, ifconfig, nslookup and traceroute. CO1, CO5 2 Capture ping and trace route PDUs using a network protocol analyzer and examine. CO1, CO4 3 Simulation of an error correction code (like CRC). CO1, CO4 4a Simulation of Flow control mechanisms: Implementation of Stop and Wait Protocol CO1, CO4 4b Simulation of Flow control mechanisms: Implementation of Sliding Window Protocol CO1, CO4 5 Simulation of DNS using UDP sockets CO3, CO4, CO5 6 Implementation of HTTP, Web Caching, FTP using socket programming CO3, CO4, CO5 7 Develop a DNS client server to resolve the given host name or IP address. CO3, CO5 8 Simulation of unicast routing protocols CO2, CO4 9 Observing Packets across the network and Performance Analysis of various Routing protocols CO2, CO4, CO6 10 Simulation of Transport layer Protocols and analysis of congestion control techniques in the network CO1, CO4, CO6 9 Rubrics for Assessment Excellent Good Average Poor Problem Understanding & Logic Design Clear understanding with efficient logic (3 marks ) Good logic with minor issues (2 marks) Partial understanding (1 mark) unclear understanding (0 mark) Code Implementation Error-free, well- structured, meets all requirements ( 3 marks ) Minor errors, mostly meets objectives ( 2 marks ) Major errors (1 mark) incomplete implementation (0 mark) Output & Viva Explanation All test cases passed, confident explanation ( 4 marks ) Some test cases passed, fair explanation ( 3 marks ) Few cases passed, weak explanation (2 marks) Attempted, No cases passed, no explanation (1 mark) 10 Ex. No: 01 Practice different network commands available in Windows and Linux Operating Systems and troubleshoot the network Aim To practice different network commands available in Windows and Linux Operating Systems like tcpdump, netstat, ifconfig, nslookup and traceroute ping. Pre Lab-Discussion : TCPDUMP The tcpdump utility allows you to capture packets that flow within your network to assist in network troubleshooting. The following are several examples of using tcpdump with different options. Traffic is captured based on a specified filter. NETSTAT Netstat is a common command line TCP/IP networking available in most versions of Windows, Linux, UNIX, and other operating systems. Netstat provides information and statistics about protocols in use and current TCP/IP network connections. IPCONFIG ipconfig is a console application designed to run from the Windows command prompt. This utility allows you to get the IP address information of a Windows computer. From the command prompt, type ipconfig to run the utility with default options. The output of the default command contains the IP address, network mask, and gateway for all physical and virtual network adapter. NSLOOKUP The nslookup (which stands for name server lookup) command is a network utility program used to obtain information about internet servers. It finds name server information for domains by querying the Domain Name System. TRACE ROUTE Traceroute is a network diagnostic tool used to track the pathway taken by a packet on an IP network from source to destination. Traceroute also records the time taken for each hop the packet makes during its route to the destination Commands : 1. tcpdump : tcpdump is a data-network packet analyzer computer program that runs under a command line interface. It allows the user to display TCP/IP and other packets being transmitted or received over a network to which the computer is attached. Tcpdump is a common open-source Linux tool used to analyse packets. It is fast, straightforward, and lightweight. Tcpdump is a simple application that works well in Linux servers without Linux-based network devices, a GUI or various IoT nodes. These attributes 11 give tcpdump an advantage over more powerful GUI-based analyzers, like Wireshark. Tcpdump is also scriptable, which means it can enable scheduled captures. 2. netstat Netstat is a common command line TCP/IP networking available in most versions of Windows, Linux, UNIX, and other operating systems. Netstat provides information and statistics about protocols in use and current TCP/IP network connections. The Windows help screen analogous to a Linux or UNIX for netstat reads as follows: displays protocol statistics and current TCP/IP network connections. #netstat 3. ipconfig In Windows, ipconfig is a console application designed to run from the Windows command prompt. This utility allows you to get the IP address information of a Windows computer. Using ipconfig From the command prompt, type ipconfig to run the utility with default options. The output of the default command contains the IP address, network mask, and gateway for all physical and virtual network adapter. > ipconfig 12 ifconfig Command ifconfig (interface configurator) command is used to initialize an interface, assign IP Address to interface, and enable or disable interface on demand. With this command, you can view IP Address and Hardware / MAC address assign to interface and MTU (Maximum transmission unit) size. 13 4. nslookup The nslookup (which stands for name server lookup) command is a network utility program used to obtain information about internet servers. It finds name server information for domains by querying the Domain Name System. The nslookup command is a powerful tool for diagnosing DNS problems. You know you are experiencing a DNS problem when you can access a resource by specifying its IP address but not its DNS name. #nslookup 5. Trace route : Traceroute uses Internet Control Message Protocol (ICMP) echo packets with variable time to live (TTL) values. The response time of each hop is calculated. To guarantee accuracy, each hop is queried multiple times (usually three times) to better measure the response of that hop. Traceroute is a network diagnostic tool used to track the pathway taken by a packet on an IP network from source to destination. Traceroute also records the time taken for each hop the packet makes during its route to the destination. Traceroute uses Internet Control Message Protocol (ICMP) echo packets with variable time to live (TTL) values. The response time of each hop is calculated. To guarantee accuracy, each hop is queried multiple times (usually three times) to better measure the response of that hop. Traceroute sends packets with TTL values that gradually increase from packet to packet, starting with TTL value of one. Routers decrement TTL values of packets by one when routing and discard packets whose TTL value has reached zero, returning the ICMP error message ICMP Time Exceeded. For the first set of packets, the first router receives the packet, decrements the TTL value and drops the packet because it then has TTL value zero. The router sends an ICMP Time Exceeded message back to the source. The next set of packets are given a TTL value of two, so the first router forwards the packets, but the second router drops them and replies with ICMP Time Exceeded. Proceeding in this way, traceroute uses the returned ICMP Time Exceeded messages to build a list of routers that packets traverse, until the destination is reached and returns an ICMP Echo Reply message. With the tracert command, we are asking tracert to show us the path from the local computer all the way to the network device with the hostname google.com. > tracert google.com 14 6. ping : The ping command sends an echo request to a host available on the network. Using this command, you can check if your remote host is responding well or not. Tracking and isolating hardware and software problems. Determining the status of the network and various foreign hosts. The ping command is usually used as a simple way to verify that a computer can communicate over the network with another computer or network device. The ping command operates by sending Internet Control Message Protocol (ICMP) Echo Request messages to the destination computer and waiting for a response # ping172.16.6.2 15 VIVA QUESTIONS Q1. What is the purpose of the `ipconfig` (Windows) or `ifconfig` (Linux) command? `ipconfig` (Windows) and `ifconfig` (Linux) are used to view and manage the network configuration of the system, including IP address, subnet mask, and default gateway. Q2. How can you test network connectivity between your system and another host? Using the `ping` command, e.g., `ping google.com` or `ping 8.8.8.8`, to send ICMP echo requests and verify if the destination is reachable. Q3. What does the `tracert` (Windows) or `traceroute` (Linux) command do? It traces the route that packets take from the source machine to the destination host, showing each hop along the path. Q4. How do you check DNS resolution is working properly? By using `nslookup` or `dig` command to check if a domain name resolves to the correct IP address. Q5. What command can you use to display all active network connections? Windows: `netstat -an` Linux: `netstat -tuln` or `ss -tuln` Q6. What is the function of the ARP command? The `arp -a` command displays the ARP (Address Resolution Protocol) table, which maps IP addresses to MAC addresses of devices in the local network. Q7. How can you renew or release an IP address from the DHCP server? Windows: `ipconfig /release` followed by `ipconfig /renew` Linux: `sudo dhclient -r` (release) and `sudo dhclient` (renew) Q8. What does the `route` command do in Windows and Linux? It displays or modifies the IP routing table. For example, `route print` (Windows) or `ip route show` (Linux) displays the routing table. Q9. How would you troubleshoot if the internet is not working but local network access is available? -Ping external IP like `8.8.8.8` to check internet. -If successful, check DNS using `nslookup google.com`. - If DNS fails, change DNS server to a public one like `8.8.8.8`. Q10. How do you list the current network interfaces and their status in Linux? You can use `ip link show`, `ifconfig`, or `nmcli device status` to list interfaces and check their current state (up/down). 16 Problem understanding and Design ( 3 marks) Code Implementation ( 3 marks) Output & Viva Explanation ( 4 marks) Total (10 marks) Result Thus, the different network commands available in Windows and Linux Operating Systems like tcpdump, netstat, ifconfig, nslookup and traceroute ping are executed successfully. 17 Ex. No: 02 Capture ping and trace route PDUs using a network protocol analyzer and examine Aim To capture and analyze ping and traceroute Protocol Data Units (PDUs) using a network protocol analyzer (Wireshark) and examine the packet details such as source and destination IP address, protocol type, ICMP message type, TTL, and round-trip behavior. Requirements • System with network access • Wireshark installed • Command Prompt / Terminal Procedure Part A: Capturing Ping Packets 1. Open Wireshark 2. Select the active network interface such as Wi-Fi or Ethernet 3. Click Start Capturing Packets 4. Open Command Prompt 5. Type the command: ping google.com or ping 8.8.8.8 6. Observe that Wireshark starts capturing packets. 7. In the Wireshark filter bar, type: icmp 8. Press Enter to display only ICMP packets. 9. Identify: o Echo Request o Echo Reply 10. Click on each packet and expand the protocol fields to examine: o Source IP address o Destination IP address o ICMP Type and Code o Time To Live (TTL) o Sequence number o Checksum Output: Ping in cmd 18 Ping captured in Wireshark Frame 28-Ping Request Part B: Capturing Traceroute Packets 1. Keep Wireshark running. 2. Open Command Prompt 3. Type: tracert google.com in Windows or traceroute google.com in Linux 4. In Wireshark, use the filter: icmp || udp because traceroute may use ICMP or UDP depending on the OS/tool. Another filter can also be used: The Wireshark display filter icmp.type == 11 || icmpv6 is used to display ICMP-related packets involved in traceroute. The condition icmp.type == 11 captures IPv4 ICMP Time Exceeded packets, while icmpv6 captures all ICMPv6 packets. Since the experiment was performed over IPv6, the relevant traceroute packets appeared as ICMPv6 Echo Requests and ICMPv6 Time Exceeded messages. 5. Observe the packets generated for each hop. 6. Examine: o TTL values increasing step by step o ICMP Time Exceeded messages from intermediate routers o Final destination response 19 Tracert in cmd Wireshark Capture of Traceroute Packets Using ICMPv6 The captured output shows ICMPv6 Echo Request packets sent with increasing hop limit values such as 5, 6, and 7. When the hop limit becomes zero at an intermediate router, that router sends an ICMPv6 Time Exceeded message back to the sender. By observing these repeated request and response packets, the route to the destination can be determined hop by hop. This confirms the working of traceroute. VIVA QUESTIONS 1. What is ping? Answer: Ping is a network utility used to test the connectivity between two hosts in a network. It sends ICMP Echo Request messages and receives ICMP Echo Reply messages. 2. Which protocol is used by ping? Answer: Ping uses the ICMP (Internet Control Message Protocol). 3. What is the main purpose of traceroute? Answer: Traceroute is used to identify the path taken by packets from the source to the destination and to find the delay at each hop.