0% found this document useful (0 votes)
17 views6 pages

Understanding Network Layer Protocols

This tutorial covers Network Layer Protocols including ARP, IP, and ICMP using Wireshark for practical understanding. It explains how ARP resolves IP addresses to MAC addresses, the function of gratuitous ARP for updating address mappings, and the role of ICMP in network communication, particularly through the ping utility. The tutorial includes practical exercises and questions to enhance comprehension of these protocols.

Uploaded by

myayoonthu2020
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views6 pages

Understanding Network Layer Protocols

This tutorial covers Network Layer Protocols including ARP, IP, and ICMP using Wireshark for practical understanding. It explains how ARP resolves IP addresses to MAC addresses, the function of gratuitous ARP for updating address mappings, and the role of ICMP in network communication, particularly through the ping utility. The tutorial includes practical exercises and questions to enhance comprehension of these protocols.

Uploaded by

myayoonthu2020
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

6202COMP Tutorial 3 - Network Layer Protocols

Introduction:
In this tutorial, we shall be looking at some Network Layer Protocols (ARP, IP and ICMP) using
Wireshark to get an understanding of how each protocol functions.

Address Resolution Protocol (ARP)


Computers on the same network and switch use MAC addresses also known as the hardware
address to communicate rather than IP Addresses. The resolution process that TCP/IP networking
(with IPv4) uses to resolve an IP address to a MAC address is called the Address Resolution
Protocol (ARP).

Scenario:
Suppose PC A wants to communicate to PC B. The transmitting computer (PC A) sends out an ARP
request that basically says,
“Hello, everybody. My IP address is [Link], and my MAC address is f2:f2:f2:f2:f2:f2. I
need to send something to whoever has the IP address [Link], but I don’t know the
hardware address. Will whoever has this IP address please respond with your MAC address?”
This packet is broadcast to every device on the network segment. Any device that doesn’t have
this IP address simply discards the packet. The device that does have the address sends an ARP
reply with an answer such as “Hey, transmitting device, I’m the one you’re looking for with the
IP address [Link]. My MAC address is 02:f2:02:f2:02:f2.”

Let’s look at this in practice….

 Open arp_resolution.pcagng with Wireshark. This capture contains two Frames 1 and 2.
 Double click on Frame 1 and you should see a window pop up similar to this:

1|Page
 The Image above shows this is an ARP request [Opcode request (1)] sent from the
transmitting computer with IP address [Link] with mac address highlighted in
red.
 The target IP is [Link]. Notice the Target MAC address is not known as this point
and contains a series of zeros.
 Double click on Frame 2 to view the response and answer the following:

Questions:
1. What is the opcode in this packet, what does it signify?
2. What is the sender and target’s IP addresses and MAC addresses respectively?
3. Look at frame 1 again and comment on what is important about the destination MAC address
in this case.
4. What else can we determine about the MAC addresses of the endpoints (e.g.
manufacturers)?

Gratuitous ARP
In many cases, a device’s IP address can change. When this happens, the IP-to-MAC address
mappings that hosts on the network have in their caches will be invalid.

2|Page
To prevent this from causing communication errors, a gratuitous ARP packet is transmitted on
the network to force any device that receives it to update its cache with the new IP-to-MAC
address mapping.
Let’s look at this in practice….

 Open the arp_gratuitious.pcagng with Wireshark. This capture contains one packet.
 Double click on the frame and you should see a windows pop like the one shown below:

1. Examining the Ethernet header, you can see that this packet is sent as a broadcast so that
all hosts on the network receive it.
2. The ARP request shows gratuitous is true.
3. The Sender IP and Target IP appears to be the same.
4. Note once a computer’s IP address is changed on a single network, it will send a gratuitous
ARP request with these information IP address and MAC address so that computers on
the same network can update their record of who the new “guy” is.

3|Page
Internet Protocol (IP)
As you just saw, MAC addresses are used for communication on a single network at layer 2. In
much the same fashion, layer 3 is responsible for addresses used in internetwork communication.
Hence Computers on different networks use Internet Protocol addresses to communicate.
Internet Protocol (IP), which currently has two versions in use—IP version 4 and IP version 6.

Open the file ip_ttl_source.pcapng in Wireshark which contains two ICMP packets. Note ICMP
uses IP to communicate as this is a ping request.

Questions
1. Double click on Frame 1.
2. What IP version is being used in this network capture?
3. What is the IP address and MAC address of transmitting computer and destination
computers respectively?
4. What is the Time-To-Live (TTL) value in this packet?
5. Double click on Frame 2 how can you determine that this is a response to the ping request
in frame 1?
6. What is the source and destination of the hosts in this packet?
7. What is the Time-To-Live (TTL) value in this packet?
8. The TTL indicates how many hops a packet transverses over a router before it reaches its
destination. So a TTL from both frames indicates one hop.

Internet Control Message Protocol (ICMP)


Internet Control Message Protocol (ICMP) is the utility protocol of TCP/IP, responsible for
providing information regarding the availability of devices, services, or routes on a TCP/IP
network. Most network-troubleshooting techniques and tools center on common ICMP message
types.

Echo Requests and Responses


ICMP’s biggest claim to fame is the ping utility. Ping is used to test for connectivity to a device.
While ping itself isn’t a part of the ICMP spec, it utilizes ICMP to achieve its core functionality. For
instance in the image below, the PING utility is used to send a ping echo request to
[Link] and to check if Google’s web server is online and up (internet connection
required).

4|Page
We get a reply from the IP address [Link]; which is Google’s IP address.

Let’s take a look in practice of an ICMP Ping Echo Request and reply.

 Open a command prompt and type in ipconfig to see the IP address of your machine
 Try to ping your own machine, does it work?
 Now try it again but start Wireshark and leave it running in the background. Do the ping
messages show up?
 Finally, ping the machine sequentially next to yours in terms of IP address, e.g. if your
address is [Link], you would ping [Link].2. Again leave Wireshark running in the
background.

Questions
1. How many frames do you see in the capture, why is this the case?
2. What might this tell us about the structure of the LAN in this lab?
3. Select a random packet from the capture, what is the IP address of the source and
destination hosts respectively?
4. What do these IP addresses represent, are they public or private? What does this mean?

5|Page
5. From the ICMP portion of this packet, determine if this request is an echo request or
reply?
6. Find a ping reply and look at the information in the ICMP field. Compare this to the output
on the console, does the data match up?

References

Sanders, C. (2017). Practical packet analysis. San Francisco, Calif.: No Starch Press.

6|Page

Common questions

Powered by AI

Network layer protocols work in conjunction to ensure effective communication across different network segments by managing both local and global addressing. ARP operates within each local network to resolve IP addresses into MAC addresses, facilitating intra-segment communication . Meanwhile, the Internet Protocol (IP) handles the addressing and routing of packets between networks, ensuring data can traverse disparate networks via routers. Furthermore, ICMP supports this process by providing diagnostic tools to verify connectivity and route availability, reporting errors back to the sender when issues arise . Together, these protocols provide seamless, layered communication throughout network infrastructures.

The Address Resolution Protocol (ARP) functions primarily at the data link layer to map IP addresses to MAC addresses, allowing devices on the same network segment to communicate using hardware addresses rather than IP addresses. This is crucial for local area network (LAN) communication . In contrast, the Internet Protocol (IP) operates at the network layer, providing a method of addressing and routing data packets between hosts on different networks. IP is responsible for delivering packets from the source to the destination across multiple networks, handling the assignment and management of IP addresses, and routing through interconnected networks .

MAC addresses are used in network communication to identify devices at the data link layer on a local network. They are hardware-based addresses that ensure local delivery of frames within the same network segment, facilitating communication between physically connected devices . In contrast, IP addresses are used at the network layer to identify devices across interconnected networks. IP addresses are logical, they can change dynamically or be assigned statically, and are essential for internetwork communication, allowing devices on different networks to route packets to each other . For example, an ARP request might use a MAC address to find another device's MAC address within the same segment, while a ping request uses IP addresses to test connectivity with devices across different networks .

Analyzing ARP requests and replies can reveal detailed information about a network's structure and its endpoints. Information such as the hardware (MAC) and logical (IP) addresses of devices can offer insights into their manufacturers and possibly their roles within the network. By examining broadcasted ARP requests and specific responses, one can determine which devices are directly communicating and infer the network's layout, including subnet configurations and potential points of segmentation. Additionally, frequent gratuitous ARP requests might indicate dynamic IP addresses or high levels of mobility within the network .

Gratuitous ARP helps maintain network communication integrity by updating the ARP caches of devices within a network segment, indicating a change in the IP-to-MAC address mapping of a device. When a device's IP address changes, it sends a gratuitous ARP broadcast to inform all other devices on the network about the new mapping. This prevents communication errors that could arise when devices attempt to send data to the outdated MAC address associated with a particular IP .

Device mobility impacts ARP operations by frequently changing IP-to-MAC address mappings, which can lead to outdated cache entries and potential communication failures. ARP adapts to such changes through the use of gratuitous ARP messages. When a device's IP address changes due to mobility, it broadcasts a gratuitous ARP to update the ARP caches of other network devices, thereby ensuring continued accurate address resolution and uninterrupted communication . This capability is crucial for environments with dynamic IP assignments, such as mobile and dynamic host configurations, facilitating seamless network integration.

Differentiating between echo request and reply messages in Wireshark is vital for analyzing network activities, such as verifying two-way communication and identifying latency issues or packet loss. Echo requests are typically sent by a client initiating communication, while replies are sent by the destination device acknowledging receipt. In Wireshark, these can be identified by examining the ICMP protocol field in the packet details; an echo request is indicated by a specific type code (usually 8), and a reply by another (usually 0). Observing the sequential occurrence of these messages helps confirm successful communication paths .

IPv4 faces several challenges that have necessitated the development and adoption of IPv6. The most significant challenge is the limited address space; IPv4 offers about 4.3 billion unique addresses, which is insufficient for the growing number of internet-connected devices. Additionally, IPv4 lacks features for modern security needs, such as native encryption and authentication, which IPv6 addresses with built-in IPsec. IPv4's inefficiency and overhead in handling routes and subnetting are also improved in IPv6, which supports hierarchical addressing and more efficient packet processing .

The Time-To-Live (TTL) value in Internet Protocol communications is crucial for controlling the lifespan of a data packet as it traverses networks. TTL prevents packets from circulating indefinitely, which could occur due to routing loops. Every time a packet passes through a router, the TTL value decreases by one. If the TTL reaches zero, the packet is discarded, and an ICMP message is typically sent back to the sender, indicating a time exceeded error. This mechanism helps maintain network efficiency and prevents congestion .

ICMP aids in network troubleshooting by providing feedback about network issues through echo requests and responses, along with error reporting. Tools like Ping, which utilize ICMP, allow administrators to test connectivity between two devices by sending echo requests and awaiting replies, revealing the presence of communication paths and potential disruptions. ICMP error messages, such as 'destination unreachable' or 'time exceeded,' highlight specific problems like routing loops or downed machines, thus enabling more efficient diagnosis and resolution of connectivity issues .

You might also like