0% found this document useful (0 votes)
7 views21 pages

CN Assignment

The document is a computer network report detailing a series of tasks to be completed using Cisco Packet Tracer, including designing a network topology with specific devices and analyzing network behavior across different OSI layers. It includes instructions for tasks related to MAC address learning, ARP and IP communication, routing and subnetting, TCP vs UDP analysis, and end-to-end packet analysis. The report emphasizes the importance of understanding network protocols and configurations for successful communication between devices.

Uploaded by

rehomiv885
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)
7 views21 pages

CN Assignment

The document is a computer network report detailing a series of tasks to be completed using Cisco Packet Tracer, including designing a network topology with specific devices and analyzing network behavior across different OSI layers. It includes instructions for tasks related to MAC address learning, ARP and IP communication, routing and subnetting, TCP vs UDP analysis, and end-to-end packet analysis. The report emphasizes the importance of understanding network protocols and configurations for successful communication between devices.

Uploaded by

rehomiv885
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

CHENNAI

CAMPUS
NAME: KIRAN RAJ J K

ROLL NUMBER:[Link].U4ECE23023

COMPUTER NETWORK REPORT

DEPARTMENT OF ELECTRONICS AND

COMMUNICATION E NGINEERING

SUBJECT CODE:23ECE312

SUBMITTED TO: Dr R Vaisshale


TABLE OF CONTENT

[Link] Question List Page No

1 ASSIGNMENT INTRODUCTION 4

2 TASK 1 6

3 TASK 2 12

4 TASK 3 15

5 TASK 4 18

6 TASK 5 22
ASSIGNMENT INTRODUCTION

Students are required to download and install Cisco Packet Tracer from the official NetAcad
website and use it to design and analyze a small network topology. After installation, create a
network consisting of one switch, one router, and five PCs labelled H1, H2, H3, H4, and H5.
Connect H1, H2, H3, and H4 to the switch, and connect the switch to the router. Then
connect H5 directly to the router. Assign appropriate IP addresses and subnet masks to all
hosts and configure the router interfaces accordingly. First, verify communication between
H1 and H2 by performing a ping and observe how the switch learns MAC addresses and
builds the MAC address table. Next, use simulation mode in Packet Tracer to analyze the
communication process and explain what happens when H1 sends a ping request to H2,
including the role of the ARP protocol and ICMP packets. Extend the configuration so that
H1 can communicate
with H5 through the router, and configure the default gateway on the hosts where necessary.
Observe the packet flow and explain how the router forwards packets between different
networks, including what happens to the source and destination MAC addresses, IP
addresses,
and the TTL value as the packet moves through the network. Students should submit the
screenshot of Packet Tracer (.pkt) file, screenshots of successful ping results, and a brief
explanation of the observed packet flow and network behavior.
Students must design the topology and analyse network behaviour across Layer 2, Layer 3,
and Layer 4.

Network Devices
• 1 Switch
• 1 Router
• 5 PCs (H1, H2, H3, H4, H5)
Topology
• Connect H1, H2, H3, and H4 to the Switch
• Connect the Switch to the Router
• Connect H5 directly to the Router

Question 1 – Layer 2: MAC Address Learning


Using Packet Tracer:
1. Connect H1, H2, H3, H4 to the Switch.
2. Assign IP addresses to the hosts.
3. Perform ping between H1 and H2.
Explain:
• How the switch learns MAC addresses.
• How the MAC address table is formed.
• What happens when the switch does not know a MAC address.
Question 2 – Layer 2/3: ARP and IP Communication
Perform a ping from H1 to H2.
Explain:
1. Which packet is generated first (ARP or ICMP).
2. How the ARP request and reply process works.
3. How the IP packet is encapsulated into an Ethernet frame.
4. Identify the source and destination MAC and IP addresses in the packet.

4
Question 3 – Layer 3: Routing and Subnetting
Extend the topology by connecting the router.
Tasks:
1. Configure router interfaces with different subnets.
2. Assign IP addresses to hosts.
3. Verify communication between H1 and H5.
Explain:
• Why routing is required between different networks.
• How the router determines the next hop using the routing table.
• What changes occur in the IP header during routing.
Question 4 – Layer 4: TCP vs UDP Analysis
Using Packet Tracer Simulation Mode:
1. Send HTTP traffic from H1 to H5.
2. Send DNS traffic from H1 to H5.
Explain:
• Difference between TCP and UDP.
• Which protocol is used by HTTP and DNS.
• What are source and destination port numbers.
• Why TCP uses a three-way handshake.
Question 5 – End-to-End Packet Analysis (Multiple Layers)
Observe a complete packet transfer from H1 to H5.

5
QUESTION 1 - MAC Address Learning

FINAL SETUP OF CISCO PACKET TRACER

H1

6
H2

H3

H4

7
H5

ROUTER SETUP
GigEth 0/0:

GigEth 0/1:

8
SERVER SETUP
Static:

HTTP:

9
HTML:

10
PING FROM H1 TO H2

11
EXPLANATION:
1. How the switch learns MAC addresses?
A switch learns MAC addresses by examining the source MAC
address of incoming Ethernet frames. When a frame arrives on a port,
the switch records the source MAC address along with the port
number in its MAC address table. This process is called MAC
learning. Over time, the switch builds a table of all connected devices.

2. How the MAC address table is formed?


The MAC address table is formed dynamically as the switch receives
frames. Each entry contains:
 MAC address of the device
 Port number on which the device is connected
Whenever a frame is received, the switch updates or adds an entry.
The table is continuously updated and old entries are removed after a
timeout.

3. What happens when the switch does not know a MAC


address?
If the switch does not have the destination MAC address in its table, it

12
performs flooding. This means the frame is sent to all ports except the
one on which it was received. Once the destination device replies, the
switch learns its MAC address and updates the table, allowing future
communication to be forwarded directly instead of flooding.

QUESTION 2 - ARP and IP Communication

Perform ping from H1 to H2

ARP PDU table:

13
EXPLAIN

1. Which packet is generated first (ARP or ICMP)


The ARP packet is generated first. Before sending an ICMP packet, the
sender must know the MAC address of the destination device (or gateway). If
the MAC address is not available, an ARP request is sent to obtain it.

2. How the ARP request and reply process works


When H1 wants to communicate with H2, it checks its ARP table for the
destination MAC address. If not found, H1 sends an ARP request as a
broadcast to all devices in the network asking “Who has this IP address?”.
The device with the matching IP (H2) responds with an ARP reply (unicast)
containing its MAC address. H1 then stores this mapping in its ARP table for
future communication.

3. How the IP packet is encapsulated into an Ethernet frame


The data is encapsulated in layers before transmission:
 First, an ICMP message is created
 It is encapsulated into an IP packet (Layer 3)
 Then the IP packet is encapsulated into an Ethernet frame (Layer 2)
The Ethernet frame contains MAC addresses, while the IP packet contains IP

14
addresses.

4. Source and destination MAC and IP addresses in the packet


For communication between H1 and H2:
 Source IP address → IP address of H1
 Destination IP address → IP address of H2
 Source MAC address → MAC address of H1
 Destination MAC address → MAC address of H2

QUESTION 3 - Routing and Subnetting


Already added the router

Communication between H1 and H5:

15
EXPLANATION:

Why routing is required between different networks?


Routing is required when devices are in different IP networks
(subnets). A switch can only forward frames within the same network
using MAC addresses. To communicate between different networks
(e.g., H1 → H5), a router is needed to forward packets based on IP
addresses.

How the router determines the next hop using the routing table?
A router uses its routing table to decide where to send packets. When
a packet arrives:
1. The router checks the destination IP address
2. It compares it with entries in the routing table
3. It selects the best matching network
4. It forwards the packet through the corresponding interface (next
hop)
In this project, the router already knows both networks (directly
connected), so it forwards packets directly to the correct interface.

What changes occur in the IP header during routing?


When a packet passes through a router:
 IP addresses (source & destination) → remain the same
 TTL (Time To Live) → decreases by 1

16
 Header checksum → recalculated
At Layer 2:
 MAC addresses change at each hop (new frame is created)

QUESTION 4 - TCP vs UDP Analysis


HTTP AND DNS TRAFFIC

17
This shows that the packet is delivered.

EXPLANATION:
Difference between TCP and UDP
TCP (Transmission Control Protocol) is a connection-oriented
protocol that ensures reliable data transfer using acknowledgments
and error checking. It establishes a connection before communication
using a three-way handshake.
UDP (User Datagram Protocol) is a connectionless protocol that
sends data without establishing a connection. It is faster but does not
guarantee delivery, order, or error correction.

Which protocol is used by HTTP and DNS


 HTTP uses TCP because it requires reliable data transfer.
 DNS uses UDP because it needs fast communication and can
tolerate some packet loss.

Source and destination port numbers


Port numbers identify applications at the transport layer:
 HTTP
o Source port → Random (client side)
o Destination port → 80

18
 DNS
o Source port → Random (client side)
o Destination port → 53

Why TCP uses a three-way handshake


TCP uses a three-way handshake to establish a reliable connection
between sender and receiver. The steps are:
1. SYN – Client requests connection
2. SYN-ACK – Server acknowledges and agrees
3. ACK – Client confirms connection
This process ensures both devices are ready before data transfer
begins.

19
QUESTION 5 - End-to-End Packet Analysis
From H1 to H5

Step-by-Step Packet Flow

When a packet is sent from H1 to H5, the communication process


involves multiple OSI layers and occurs in several steps.
Initially, H1 does not know the MAC address of its default gateway,
so it sends an ARP request (broadcast) asking for the MAC address
of the router. The router responds with an ARP reply, providing its
MAC address. This allows H1 to proceed with communication.
Next, H1 generates an ICMP Echo Request packet (ping), which is
encapsulated inside an IP packet and then inside an Ethernet frame.
The frame is sent to the switch, which forwards it based on its MAC
address table.

20
The frame reaches the router, where the router removes the Layer 2
header, examines the destination IP address, and determines the
correct outgoing interface using its routing table. The router then
creates a new Ethernet frame with updated MAC addresses and
forwards the packet to H5. During this process, the IP addresses
remain unchanged, but the TTL (Time To Live) value decreases.
When H5 receives the packet, it processes the ICMP request and
sends an ICMP Echo Reply back to H1. The reply follows the same
path in reverse, passing through the router and switch until it reaches
H1.
Thus, the complete communication involves ARP for address
resolution, switching at Layer 2, routing at Layer 3, and ICMP at
Layer 4, demonstrating end-to-end packet delivery across multiple
network layers.

21

You might also like