Implementation of Ip Commands Such As Traceroute, Nslookup: Data Communication Network Lab Project Report On
Implementation of Ip Commands Such As Traceroute, Nslookup: Data Communication Network Lab Project Report On
BACHELOR OF TECHNOLOGY
In
Electronics and Communication Engineering
By
K .RAMYASRI (Roll No: 22D41A0455)
K.RITHIKA (Roll No: 23D41A0454)
K.SHIVANI (Roll No: 22D41A0453)
K. PAVAN KUMAR (Roll No: 22D41A0457)
When you start the traceroute command, it sends a packet (using the Internet Control Message
Protocol or ICMP) with a time limit value (known as the 'time to live' - TTL). The first packet
has a TTL of 1, the second packet has a TTL of 2, etc. Increasing TTL in such a manner, it
resends the packet so that you can reach the first, the second and other routers on the way to the
destination. When a router receives the packet, it sends a Time Exceeded message, which
provides an opportunity to determine the time required for the hop to the router. Each time a
packet is passed to a new router, the TTL is decreased by 1. When it reaches 0, the packet is
discarded, and the router returns an error message.
NSLOOKUP
The primary purpose of nslookup is to retrieve detailed information about the specified domain.
This information is essential for troubleshooting DNS-related problems.
LIST OF NSLOOKUP COMMANDS
There are various types of nslookup commands for requesting different domain information.
The most commonly used commands include:
name – shows information about the domain name or hostname using the default server.
server name – sets a different default DNS server using the current one’s information.
root – assigns the root server as the default.
set type=<record type> – queries a specific DNS record type, such as A, MX, PTR, or SOA.
Use ANY to display all server records.
set debug – displays debugging information about each query and its corresponding response.
set recurse – asks the DNS nameserver to query other servers if it can’t provide the
information.
help – shows a list of nslookup commands and their functions.
exit – quits the nslookup tool and returns users to the CLI.
METHODOLOGY
To implement a command like traceroute, the program sends packets (e.g., ICMP Echo Request
or UDP) with incrementally increasing Time-To-Live (TTL) values to the target IP address. The
TTL determines how many hops a packet can traverse before being discarded. Each router along
the route decrements the TTL by one, and when it reaches zero, the router responds with an
ICMP "Time Exceeded" message. The program starts with a TTL of 1 and increments it step-
by-step, recording the IP address and response time of each intermediate router until the
destination responds (with an ICMP Echo Reply for ICMP-based traceroute, or a "port
unreachable" message for UDP). The program uses raw sockets to craft and send packets and
listens for responses, extracting the sender's IP and timing information. The process stops when
the destination is reached or a predefined TTL limit is exceeded.
To implement a command like nslookup, the program interacts with the Domain Name System
(DNS) to resolve domain names to IP addresses and vice versa. It constructs a DNS query
packet containing the desired hostname, query type (e.g., A for IPv4, AAAA for IPv6, or PTR
for reverse lookups), and query class (usually IN for Internet). This packet is sent to a DNS
server using UDP (or TCP for larger queries) on port 53. The server responds with a DNS
response packet containing the requested information, such as the resolved IP address or
additional records.
TESTING AND DISCUSSION
TRACEROUTE:
For Windows
3. Input:
tracert ***
You need to use the domain name, the server's name or its IP instead of ***.
4. Press Enter.
NSLOOKUP:
The Nslookup command is a DNS lookup utility. You can use the following commands to look
up the information for a selected hostname:
RESULT
Hence we have implemented the various IP commands such as TraceRoute and Nslookup
Traceroute and nslookup are indispensable tools in network troubleshooting and diagnostics.
Traceroute provides visibility into the path that packets take to a destination, aiding in identifying
routing issues, delays, and network bottlenecks. Nslookup simplifies domain name resolution,
helping administrators debug DNS configurations and resolve issues with name-to-IP or IP-to-
name mappings. Both commands empower users with critical insights into the functioning of
network and DNS infrastructure, ensuring smoother connectivity and performance.
REFERENCE
Ping , Traceroute and nslookup.. Lets see all these cmds in detail… | by The_Anshuman |
Medium
What are Traceroute, Ping, Telnet and Nslookup commands? - Hosting - Namecheap.com
Network configuration and troubleshooting commands in Linux - GeeksforGeeks