BSD2301_NETWORK_PROGRAMMING_ENGINEERING_ASSIGNMENT1_GROUPWORK
BSD2301_NETWORK_PROGRAMMING_ENGINEERING_ASSIGNMENT1_GROUPWORK
ASSIGNMENT 1
GROUP WORK
MEMBERS
Sadia Galm - 19/03455
Stephen Migwi - 24/00387
Anzal Ali - 20/02308
James Daniel - 21/04996
Venessa Obote - 21/03204
Ann Wambui - 20/04294
Giovane Henry - 17/04340
Zeyruq Abdullahi - 23/04126
Edna Wambui - 19/06197
Abass Kuku - 22/08714
You are supposed to explore the various tools that an end user can use to discover how a
machine is connected to the network and what the network looks like beyond the first hop. You
investigation will use the following tools:
1. netstat
2. traceroute
3. whois
All of these tools should be available on any machine running a UNIX-based operating system.
1. netstat
i). What is netstat and what is it used for?
The netstat command generates displays that show network status and protocol statistics
ii). What parameters for netstat should you use to show all the TCP connections
established? Include a printout of this list for your machine. Be sure to explain what all
fields are.
-a Display all active TCP and UDP connections and listening ports.
-t Display only TCP connections.
-u Display only UDP connections.
l- Show only sockets that are actively listening for incoming connections.
-p Display the Process ID (PID) and program name associated with each socket.
-n Display addresses and port numbers in numeric format without resolving names.
-r Display the kernel routing table.
-s provide summary statistics for each protocol
-c continuously update the output every second
-e display extended information, including timers and users IDs
FIELDS EXPLANATION
Local Address - The IP address and port number of the local end of the connection.
Foreign Address: The IP address and port number of the remote end of the connection. If the
port number is *, the connection is listening on all ports.
N|B Because we did not identify any malicious software, our program ends here, but
incase found, the process will continue with the remaining steps.
4. Identify programs using specific ports using netstat -tulpn | grep <port_number>
5. Monitor for rapid connection attempts using netstat -ntu
2. traceroute
i).Explain in detail how traceroute works.
A traceroute / trace route is a network diagnostic tool used to track the path that packets take
from one computer to another across a network, such as the Internet. It helps in identifying the
route taken by data packets to reach a specific destination and can be useful for troubleshooting
network issues.
How it works
1. Sending Packets - When you run a traceroute command, it sends a series of Internet Control
Message Protocol (ICMP) Echo Request packets to the target destination. Each packet has a
Time To Live (TTL) value that determines how many hops (routers) the packet can pass
through before being discarded.
2. TTL Value - The TTL value starts at one and is incremented with each subsequent packet
sent. For example, the first packet has a TTL of 1, which means it can only reach the first
router. When this packet reaches the first router, the router decrements the TTL value. If the
TTL reaches zero, the router discards the packet and sends back an ICMP Time Exceeded
message to the source.
3. Recording Hops - The source machine receives the ICMP message and records the IP
address of the router that sent it back. Then, the traceroute tool sends another packet with a TTL
of 2, which reaches the second router, and the process repeats. This continues until the packet
reaches the target destination or until a specified number of hops is reached.
4. Output - The output of a traceroute typically shows the list of routers (hops) between the
source and destination, along with the round-trip time (RTT) for each hop. This information can
help identify where delays or issues are occurring in the network.
Traceroute is a valuable tool for network administrators to diagnose routing problems, latency
issues, or to visualize the path data takes over the Internet.
Include a copy of the output and explain what happened including a description of what
each of the field’s means.