AN Assignment 1 2023
AN Assignment 1 2023
● The first two bits are 11, which falls under Class C.
● So, this address belongs to Class C.
ARP Cache:
An ARP cache, also known as an ARP table or ARP cache table, is a data structure
maintained by network devices, such as computers, routers, and switches, to store
recently resolved ARP entries. The ARP cache is used to optimize network
communication by avoiding repetitive ARP requests and responses for frequently
accessed devices.
Here are some key points about the ARP cache:
1. Temporary Storage: When a device resolves an IP address to a MAC address
through ARP, it stores this mapping in its ARP cache. This entry typically has a
time-to-live (TTL) associated with it, after which it expires.
2. Efficiency: ARP caches are crucial for network efficiency. Instead of
broadcasting ARP requests every time a device needs to communicate with another
on the local network, it can check its ARP cache first. If the required mapping is
present and valid, it can use the MAC address directly.
3. Dynamic Updates: ARP cache entries are dynamic and can change over time. If
a device's IP address or MAC address changes, the corresponding ARP cache entry
will be updated accordingly.
4. Security Implications: Attackers can manipulate ARP caches through techniques
like ARP poisoning or ARP spoofing to redirect network traffic. This can lead to
security vulnerabilities, so ARP cache security is important in network
management.
6. Sender Hardware Address (SHA): This field contains the MAC address of the sender of the ARP message.
7. Sender Protocol Address (SPA): This field contains the IP address of the sender of the ARP message.
8. Target Hardware Address (THA): This field is typically left empty (all zeros) in ARP Request messages. In
ARP Reply messages, it contains the MAC address of the target device.
9. Target Protocol Address (TPA): This field contains the IP address for which the sender is seeking the
corresponding MAC address.
The entire ARP message is encapsulated within an Ethernet frame when used in an Ethernet-based network.
The Ethernet frame includes the source and destination MAC addresses, an EtherType field indicating that it's
an ARP message, and the ARP message itself.
ARP messages play a critical role in local network communication by enabling devices to resolve the MAC
addresses of other devices based on their IP addresses, facilitating data packet transmission within the network.
Chapter: Internet Protocol
Q-7. Describe the following terms:
a) MTU:-MTU, or Maximum Transmission Unit, is the largest packet size a
network can handle without breaking it into smaller pieces. Different
networks have their own maximum sizes. When data is too big for a
network's MTU, it gets divided, which can slow things down. It's important to
set the right MTU size for efficient communication.
(f) Routing Table:-Network devices like routers maintain routing tables that
store information about the available network paths.
Q-8. Describe the IP datagram format.
ANSWER:-
An IP datagram is the basic unit of data in the Internet Protocol (IP) suite, which is used for sending data across
computer networks, including the internet. The IP datagram format consists of various fields that contain
information necessary for routing and delivering data from the source to the destination. Here is a simplified
description of the key fields in an IPv4 datagram:
1. Version: This field indicates whether the datagram is using IPv4 (value 4) or IPv6 (value 6). In an IPv4
datagram, this field is set to 4.
2. Header Length (IHL): IHL specifies the length of the IP header in 32-bit words. It is needed to know where
the data payload begins. Common values are 5 (for no options) or higher if additional options are present.
3. Type of Service (ToS): This field is used to indicate the quality of service requested for the datagram, such as
priority or reliability. In practice, it is rarely used or replaced with Differentiated Services (DiffServ) markings.
4. Total Length: This 16-bit field specifies the total length of the IP datagram, including both the header and the
data payload. It ranges from 20 bytes (minimum header size) to 65,535 bytes (maximum size for IPv4).
5. Identification: This field is used for uniquely identifying a datagram. It helps in reassembly of fragmented
datagrams, if fragmentation is necessary.
6. Flags and Fragment Offset: These fields are used for fragmentation and reassembly. The Flags field includes
a "Don't Fragment" (DF) bit and a "More Fragments" (MF) bit, while the Fragment Offset specifies the position
of a fragment within the original datagram.
7. Time to Live (TTL): TTL is a counter that decrements by one each time the datagram is forwarded by a
router. If TTL reaches zero, the datagram is discarded to prevent it from circulating indefinitely in the network.
8. Protocol: This field identifies the higher-level protocol (e.g., TCP, UDP, ICMP) to which the data payload
belongs.
9. Header Checksum: The header checksum is used for error-checking the IP header. It ensures the integrity of
the header during transmission.
10. Source IP Address: This 32-bit field contains the IP address of the sender (source) of the datagram.
11. Destination IP Address: This 32-bit field contains the IP address of the intended recipient (destination) of
the datagram.
12. Options: This field is optional and may contain various control and configuration information. It is rarely
used and can be omitted for simplicity.
13. Data Payload: This is where the actual data being transmitted is located. Its size varies depending on the
"Total Length" field.
The IP datagram is a fundamental building block of internet communication, helping devices route and deliver
data across networks. While this description is based on IPv4, IPv6 datagrams have a different format but serve
a similar purpose, allowing for more addresses and improved functionality.
Q-9. Which are the fields in an IP datagram format that controls fragmentation? Explain the fields.
ANSWER:-
In an IP datagram, several fields are responsible for controlling fragmentation. Fragmentation is the
process of breaking up a large IP datagram into smaller fragments when it needs to traverse a
network with a smaller Maximum Transmission Unit (MTU). The key fields that control
fragmentation in an IPv4 datagram are as follows:
1. **Flags:**
- Bit 1: Don't Fragment (DF) bit, which, when set to 1, indicates that the datagram must not be
fragmented. If a router along the path encounters a datagram with the DF bit set and needs to
fragment it, the router discards the datagram and sends an ICMP "Destination Unreachable"
message back to the sender.
2. **Fragment Offset:**
- It specifies the position of the fragment in the original datagram. This field is used to reassemble
the fragments correctly at the destination.
- The offset is measured in units of 8 bytes, so if the offset is set to 2, it means the fragment starts
at byte 16 in the original datagram.
- It indicates whether there are more fragments to follow. When set to 1, it means there are
additional fragments, and the destination should expect more fragments. When set to 0, it means it is
the last fragment.
When a large datagram encounters a router with a smaller MTU, it needs to be fragmented into
smaller pieces. The router sets the MF bit to 1 for the first fragment and provides the appropriate
offset. Subsequent fragments also have the MF bit set to 1 and appropriate offsets until the final
fragment, where the MF bit is set to 0.
At the receiving end, the fragments are reassembled in the correct order using the Fragment Offset
field to ensure that the original datagram is reconstructed accurately. If the DF bit is set, and a router
along the path can't forward the datagram without fragmentation, it discards the datagram and sends
an ICMP message back to the sender, indicating that the datagram was too large and could not be
fragmented.