Professional Documents
Culture Documents
Questions and Answers To Previous Years Papers
Questions and Answers To Previous Years Papers
Questions and Answers To Previous Years Papers
Q1. What is the ICMP protocol ? Explain the ICMP header format with
Diagram.
Ans:
1. The Internet Control Message Protocol (ICMP) is a supporting protocol in the Internet
Protocol suite.
2. It is used by network devices, including routers, to send error messages and
operational information indicating success or failure when communicating with
another IP address.
For example, an error is indicated when a requested service is not available or that
host or router could not be reached.
3. ICMP differs from transport protocols such as TCP and UDP in that it is not typically
used to exchange any data between systems, nor is it regularly employed by end-user
network applications.
4. When something unexpected occurs during packet processing at a router, the event is
reported to the sender by the ICMP.
5. It is used to test the internet.
6. It is a NETWORK LAYER PROTOCOL.
7. There is no TCP or UDP port number associated with the ICPM packets as these
numbers are associated with the transport layer above.
HEADER FORMAT:
The ICMP header starts after the IPv4 header and is identified by the IP protocol number ‘1’.
All ICMP packets have an 8 byte header and a varied-size data section. The first 4 bytes of
the header have fixed format, while the last 4 bytes depend on the type/code of that ICMP
packet.
Rest of header - Four-bytes field whose content varies based on type and code
Messages:
Type = 5 Code = 0,1,2,3IP address = 32 bit address of the gateway to which the
redirection should be sent
IP header and additional data is included to allow the host to match the reply with the request
that caused the redirection reply.
Advantage:
Disadvantage:
Q2. What is the need to map IP address to MAC address? Explain which
protocol does this. Similarly which protocol does the reverse mapping?
Ans:
1. Both MAC Address and IP Address are used to uniquely define a device on the
internet. The main difference between MAC and IP address is that, MAC Address is
used to ensure the physical address of a computer.
2. It uniquely identifies the devices on a network.
3. IP addresses are used to uniquely identify the connection of network with that device
which takes part in a network.
4. MAC addresses are required to make a local Ethernet (or wifi) network function.
5. Network switches can use MAC addresses to optimise the flow of network traffic.
6. The switch will use either ARP or packet sniffing to identify which devices are
connected to which port.
Data-link layer NICs like ethernet does not understand IP addresses. We need the physical
address in this case.
Even if the IP software on the destination machine can look at the address and see that the
destination is on it’s own network, it still needs to find the destination Ethernet address to
send the frame. One solution is to keep a configuration file that maps IP addresses onto
Ethernet addresses but is not possible for thousands of machines.
A better solution is to send out a broadcast packet onto destination network and get a
response which is sent back from the destination machine with the MAC address. This can be
done using ARP.
The protocol used to map IP addresses to MAC address is ARP(Address Resolution Protocol)
Procedure:
1. Before sending the IP packet, the MAC address of destination must be known. If not
so, then sender broadcasts the ARP-discovery packet requesting the MAC address of
the intended destination.
2. Since ARP-discovery is broadcast, every host inside that network will get this
message but the packet will be discarded by everyone except that intended receiver
host whose IP is associated.
3. Now, this receiver will send a unicast packet with its MAC address (ARP-reply) to
the sender of ARP-discovery packet. After the original sender receives the ARP-reply,
it updates ARP-cache and start sending unicast message to the destination.
The protocol used to map MAC addresses to IP address is RARP(Reverse Address
Resolution Protocol)
1. In order to get an IP address for a MAC address, we use the reverse address resolution
protocol.
2. When a new machine is setup, it requests an IP address from the gateway on which
the RARP server is configured to map physical addresses(MAC) to IP addresses.
3. A special host configured inside the local area network, called as RARP-server is
responsible to reply for these kind of broadcast packets.
4. It uses an IP to MAC address mapping table./
Ans:ALOHA and Slotted ALOHA both are the Random Access Protocols, that are
implemented on the Medium Access Control (MAC) layer, a sublayer of Data Link Layer.
The purpose of the ALOHA protocol is to determine that which competing station must get
the next chance of accessing the multi-access channel at MAC layer. Some of the Key
Differences between them are:-
1. In this ALOHA, any station can 1. In this Slotted ALOHA, any station
transmit the data at any time. can transmit the data at the beginning
of any time slot.
2. The time of Sender and Receiver is 2. The time of Sender and Receiver is
continuous and not globally discrete and globally synchronized.
synchronized.
3. Vulnerable time for pure aloha 3. Vulnerable time for Slotted aloha
= 2 x Tt = Tt
6. Pure aloha doesn’t reduces the 6. Slotted aloha reduces the number of
number of collisions to half. collisions to half and doubles the
efficiency of pure aloha.