Linux Foundations / Read Network Evidence

Inspect listeners and combine network clues

Lesson 33 of 37. Open to read. No account needed.

A running process is not necessarily waiting for network connections. Even a local listening socket does not prove that a remote client reaches the application. You need to know which machine, address, family, protocol and port the evidence describes.

You will inspect the guest's existing TCP and UDP sockets, save the actual results and combine them with supplied name, route and ICMP cases. There is no new server to install or start. The earlier one-shot course service printed a journal message; it did not create a network listener.

1. Identify the endpoint before asking whether it is available

Complete Separate name resolution from reachability and settle its cleanup first. Keep its distinction between a name-service answer, a local route decision and an ICMP reply.

A socket is an operating-system communication endpoint. For the IP sockets examined here, the local address and port identify where it is bound. The protocol also matters: TCP port 8080 and UDP port 8080 are different transport endpoints.

TCP uses connections. A TCP socket in LISTEN is waiting for connection requests at its local endpoint. That state does not prove that any particular client's request arrived or that the application answered it successfully.

UDP carries connectionless datagrams. A UDP socket can be bound to a local address/port without a selected peer; ss commonly displays that as UNCONN. Do not read it as a failed TCP connection, or require a TCP LISTEN state for UDP. A bound UDP endpoint is still not evidence that a remote application's datagram was received or handled.

Before combining observations, write the intended endpoint in words: which machine, which destination address, IPv4 or IPv6, TCP or UDP, and which port? Then ask whether each observation describes that same goal and a relevant time. A local guest socket report cannot establish which listeners exist on ubuntu.com.

Four separate evidence cards cover guest address and route, NSS name service, local TCP or UDP sockets, and bounded ICMP. Connectors group observations for a limited assessment of the same intended connection, with each observation's client or server location, address, family and time made clear, and protocol and intended port specified for sockets. Application reachability still needs evidence.

Read each card as a different question. The grouping connectors collect matching evidence; they are not a command sequence or a picture of packet travel. Client and server observations can come from different machines; record their roles instead of requiring every observation to be local. A guest-local ss report does not establish ubuntu.com's listeners. The diagram does not turn a local listener or an ICMP reply into proof of an application response. Keep the intended endpoint and remaining unknowns beside any conclusion.

2. Check the guest and the new inspection command

Use the ordinary nonzero-UID account in the declared full Ubuntu guest. Preserve the guest's existing services and network configuration. Inspect the taught command origins before creating the note:

type cd pwd printf set type id ps mkdir ls cat rm rmdir ss
type -a ls
type -P ls

Require the expected Bash builtins and guest utilities. The only accepted ls alias is the understood color-only form, with no hidden function or unexplained origin. Require ss to be the expected guest executable, not a custom alias or wrapper. A missing tool is a readiness issue; do not install anything to make this lesson's output appear.

Then inspect the already-taught identity and shell context:

id -u
id -un
ps -p $ -o comm=
ps -p 1 -o comm=
set -o

Require the recorded ordinary account, Bash and the full guest's systemd PID 1. Preserve a different context and reconcile it. Keep the taught errexit-off baseline so a failed query can be interpreted. Run one line at a time, read every result and stop after unexpected setup/file errors.

The new tool ss reports socket information. Read these options before use:

OptionScope in this lesson
-lSelect listening sockets; for UDP, interpret the selected unconnected bound-socket state using UDP's own semantics.
-tSelect TCP sockets.
-uSelect UDP sockets.
-nKeep port numbers numeric instead of resolving service-name labels.
-4Restrict the selected report to IPv4; used in the independent comparison.

The guided TCP and UDP forms do not explicitly restrict the address family, so actual reports can include IPv4 and IPv6 rows. They are snapshots in this guest's current network context, not every machine or every protocol. This task changes no namespace, creates no application listener and does not close existing application sockets. It sends no probe and uses no sudo.

3. Create one note for actual socket observations

The task owns ~/linux-practice/inspect-listeners-and-failure-evidence/ and only its network-evidence.txt file. Inspect the known parent and new task entry without following an unexpected link:

ls -ld ~/linux-practice
ls -ld ~/linux-practice/inspect-listeners-and-failure-evidence

Require the ordinary parent owned by your recorded account and the task name absent. An existing entry belongs to the resume branch. After acceptance:

mkdir ~/linux-practice/inspect-listeners-and-failure-evidence
ls -ld ~/linux-practice/inspect-listeners-and-failure-evidence

Accept that ordinary owned directory before entering and checking it:

cd ~/linux-practice/inspect-listeners-and-failure-evidence
pwd
ls -a

Require the exact recorded task path and only dot entries, then create the absent note with this exact two-line seed:

printf '%s\n' 'Local socket observations' 'Actual guest reports; supplied cases stay separate.' > network-evidence.txt
ls -ld -- network-evidence.txt
cat network-evidence.txt

Require the ordinary owned single-link file and exact contents. Before every later append, recheck the note identity and cwd. Require each header and redirection to succeed. The taught >> file 2>&1 appends stdout and directs stderr to that same destination, without promising stream arrival order. Save each query's immediate $? before another command replaces it.

4. Inspect TCP without inventing a listener

After the note and location gates, capture the actual TCP report:

printf '%s\n' '--- Actual guest TCP listener snapshot ---' >> network-evidence.txt
ss -l -t -n >> network-evidence.txt 2>&1
printf 'TCP listener query exit: %s\n' "$?" >> network-evidence.txt
cat network-evidence.txt

Require query success before interpreting the socket rows. A successful report with no selected data rows is valid evidence; a query error is not an empty successful report. Preserve actual headers, spacing and diagnostics.

This is a supplied illustrative row, not expected guest output:

State  Recv-Q Send-Q Local Address:Port Peer Address:Port
LISTEN 0      128    127.0.0.1:8080    0.0.0.0:*
PartMeaning and limit
LISTENA TCP socket is listening at the local endpoint in this snapshot.
127.0.0.1:8080IPv4 loopback address and port 8080 inside that same guest/context.
Peer Address:PortThe peer side of the report. A wildcard here does not identify a connected remote client.
0.0.0.0:* in the peer columnA wildcard peer representation for this listener, not a claim about its local bind address.
Queue columnsSocket-report counters. Their displayed values are not an application-health verdict.

The column matters. A local IPv4 binding of 0.0.0.0:8080 would mean the wildcard local IPv4 address at that port, rather than loopback alone. It still would not prove that a firewall, route, NAT boundary or application allows a remote client's request. Do not confuse that local meaning with the peer wildcard in the supplied row.

An IPv6 local endpoint can appear with brackets, such as [::]:8080. Do not infer IPv4 acceptance from an IPv6 row: family behavior depends on the actual socket/configuration, which this report alone does not settle. Use the taught explicit IPv4 selection for the independent observation.

Read your actual report. There may be no matching listener, different ports or additional existing services. Do not start a daemon, expose a port or attribute a row to the one-shot course service to fit the example.

Predict: a client wants the guest's non-loopback IPv4 address on TCP port 8080. Does a loopback-only local row prove that endpoint is available? Keep the local and peer columns separate when answering.

5. Inspect UDP as UDP

After rechecking the same note/cwd, capture the actual UDP report:

printf '%s\n' '--- Actual guest UDP bound-socket snapshot ---' >> network-evidence.txt
ss -l -u -n >> network-evidence.txt 2>&1
printf 'UDP bound-socket query exit: %s\n' "$?" >> network-evidence.txt
cat network-evidence.txt

Require successful query execution before classifying its rows. This is another supplied illustrative row, not a service to create:

State  Recv-Q Send-Q Local Address:Port Peer Address:Port
UNCONN 0      0      0.0.0.0:9090      0.0.0.0:*

The row describes an unconnected UDP socket bound to the wildcard local IPv4 address at port 9090. It is not a TCP listener and does not demonstrate a completed connection handshake. UDP can also have a selected default peer; this selected report is not an inventory of every possible UDP use. An UNCONN row alone does not establish that the socket belongs to a server rather than another application role.

The wildcard local binding is broader than loopback, but it is still local socket evidence. It does not prove that a remote datagram reached the application or that a reply returned. Do not compare TCP and UDP rows as though equal port numbers meant the same endpoint.

6. Combine supplied clues without erasing their scope

These four cases are supplied reasoning records, separate from your actual ss note. They do not instruct you to create faults or launch probes.

Supplied caseSupported conclusionUseful next observation and remaining limit
Named getent query returned no entry/status 2; the guest had an address and default route.That configured name-service query did not find the key. A route does not make name resolution succeed.Compare a current family-specific named lookup on the same client; it still does not identify a particular DNS component or prove a listener.
A numeric selected-route lookup reported unreachable in its recorded context.That lookup lacked a usable selected route to the numeric destination.Re-read matching current address/main-route evidence and the target/context. A main-table default alone is not every policy route, and no packet reply was tested.
The intended service is this guest's IPv4 TCP endpoint 127.0.0.1:8080; a successful complete IPv4 TCP listener report has no data rows.No selected IPv4 TCP listener was observed in that guest/context/time.Reconfirm the intended endpoint and the current matching socket report; do not install a server or infer anything about another machine.
A named ICMP attempt had route/name evidence, three requests and zero replies/status 1.No Echo Reply was recorded in that bounded attempt.Compare the same selected target/family and available evidence; silence does not prove a host or application is down.

Name queries can reflect local NSS sources; their success is not proof of a fresh DNS exchange. A numeric route get sends no packet. With count and deadline together, ping status 1 can also accompany partial replies, so the last case's explicit zero count matters. A successful ICMP exchange would still not establish application success.

The most useful next observation addresses the missing fact for the same intended endpoint. For example, a guest ss report cannot answer whether ubuntu.com is listening on TCP port 443. Changing the inspected machine would change the question; this course does not authorize accessing that remote machine or scanning it to obtain the missing evidence.

Independent task: match the bind address, then narrow the actual report

This is a new supplied combined case. All its socket evidence refers to the stated guest and recorded time; no live configuration is implied:

Client goal: guest 192.168.122.23, IPv4, TCP port 8080.
Saved name result: the intended name mapped to 192.168.122.23.
Saved client route: selected a route to that destination.
Saved ICMP record: an Echo Reply returned from that address.
Complete guest IPv4 TCP LISTEN report: exactly the following data row.
LISTEN 0 128 127.0.0.1:8080 0.0.0.0:*
No application response was tested.

Before the hints or answer:

  1. Identify the client's intended destination endpoint on the guest and the different endpoint actually shown by the supplied listener row.
  2. Explain why successful name, route and ICMP observations do not remove that difference. Does the peer wildcard change the local bind address?
  3. State the most useful missing or renewed observation for this same goal, including machine, family, protocol, address/port and time.
  4. In your actual guest, collect ss -4 -l -t -n in a new labelled section with its immediate status. Compare it with your earlier actual TCP snapshot. Do not assume an empty result is an error or that the supplied guest address/listener exists on your VM.

Success: retain three actual socket-query sections and statuses, classify the supplied cases with supported conclusions, and identify the missing evidence without opening a port or changing a setting. An unavailable query remains an observation gap; a supplied row cannot replace it.

Graduated hints

  1. Compare the local address as well as the port. Loopback and the guest's non-loopback address are different destinations for this purpose.
  2. The peer wildcard is in another column. It does not broaden a loopback local binding. Replies to ICMP also do not prove TCP application behavior.
  3. Add only the already-explained -4 to the taught TCP listener report. Keep actual output/status separate from the supplied row and compare timestamps/context as well as the selected family.

Answer and Reasoning

The supplied client intends the guest's non-loopback IPv4 address 192.168.122.23 on TCP port 8080. The only supplied local listener is 127.0.0.1:8080, the guest's loopback endpoint. Its peer wildcard is not a wildcard local bind. At the recorded time, that complete IPv4 TCP report does not show the intended non-loopback endpoint listening.

The name and route observations identify/address a destination; the ICMP reply adds evidence about that protocol's exchange. None turns the local loopback TCP binding into the requested non-loopback one. The case has not tested an application response, and the correct next step is not to change the binding or disable a firewall as part of this lesson.

A useful renewed observation is the current IPv4 TCP listener report on that same intended guest, checking the exact local address and port. It can establish whether the recorded binding still describes the current state. Further application evidence would still be needed to claim that the remote client succeeds, even if a matching local binding appeared.

For the actual independent report, first accept the exact task cwd and ordinary owned single-link note, then require each append to succeed:

printf '%s\n' '--- Actual guest IPv4 TCP listener snapshot ---' >> network-evidence.txt
ss -4 -l -t -n >> network-evidence.txt 2>&1
printf 'IPv4 TCP listener query exit: %s\n' "$?" >> network-evidence.txt
cat network-evidence.txt

Interpret successful rows or successful emptiness before comparing them with the earlier TCP section. IPv6 rows are outside this explicit selection. Rows can also change because the observations occurred at different times; do not attribute every difference solely to the new family option.

Your real guest might have no IPv4 TCP listener on any shown port. That is valid scoped evidence, not a failed requirement to create a server. Keep the supplied combined case out of the actual note sections and explain the remaining uncertainty in your own words.

Diagnose a misleading conclusion

Observation or claimCorrection
The course service was active, so it must listen.Its one-shot printf has no network endpoint in the course unit. Process/unit state is different evidence.
A TCP LISTEN row proves remote access.It establishes a local listening endpoint in that snapshot, not client delivery or application response.
UDP UNCONN means a broken TCP session.UDP has different datagram/peer semantics; do not import TCP states.
A peer wildcard makes a loopback listener public.Read the local bind column separately. Wildcard local IPv4 binding also would not prove external access.
An IPv6 row proves IPv4 is accepted.The row alone does not establish the socket's IPv4 behavior.
No data rows means the tool failed.Use the immediate status and diagnostics; successful emptiness differs from a query error.
Guest ss proves the remote website has no listener.The inspected machine/context is wrong for that conclusion.
A later report differs.Check time, context, protocol and family before claiming a configuration change or failure.

Cleanup and resume

Finish the independent observation and reasoning first. No listener, probe process or network configuration was created, so there is no server or network cleanup to run. Remove only the owned evidence note when finished.

Inspect the known parent/task entries:

ls -ld ~/linux-practice
ls -ld ~/linux-practice/inspect-listeners-and-failure-evidence

Require ordinary directories owned by the recorded account, then enter and verify separately:

cd ~/linux-practice/inspect-listeners-and-failure-evidence
pwd

Require the exact recorded task path before reading its inventory and note:

ls -a
ls -ld -- network-evidence.txt
cat network-evidence.txt

Require only dot entries and the recognized ordinary owned single-link note. Preserve unexpected entries or unfinished evidence. Establish the actual documented confirmation responses, rather than guessing an unfamiliar affirmative response from English y/n examples. Only after acceptance:

rm -i -- network-evidence.txt

Refusal preserves the note and stops cleanup. After accepted removal:

ls -a

Require the task empty before returning and checking:

cd ~/linux-practice
pwd

Require the recorded shared-root path, then inspect the task entry:

ls -ld -- inspect-listeners-and-failure-evidence

Only after accepting that ordinary owned empty directory:

rmdir -- inspect-listeners-and-failure-evidence

Retain the shared root, all existing sockets/services and all network configuration. On resume, recheck the guest, ordinary identity, origins, note and cwd. Read previous sections; append a labelled new query rather than inventing a lost status or replacing an old snapshot. A later $? cannot recover an earlier one, and a new socket report may legitimately differ.

Sources and other study views

The ss companion documents the same iproute2 6.1 family as the selected Noble baseline. The IP/UDP and getent companion manuals are man-pages 6.03; the ping companion is iputils 20221126, older than Noble's 20240117 family. The Coreutils manual is newer than the selected 9.4 tools. Only the bounded forms and concepts above are used. Actual guest socket rows, addresses and diagnostics remain observations to collect, not promised example output.

Revision rebuilds the endpoint and evidence distinctions. Quick Reference retrieves the selected socket-query forms.

Study this course with an account

Course access adds revision notes, the Quick Reference, saved progress, bookmarks and your own notes.

INR 99 plus 18% GST. 90 days of online access. No auto-renewal.

See course access

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy