Data Communication & Networks · 2025–26

DCN Practical Exam Kit

Ten selected experiments · aim, procedure, runnable code, illustrated output and result

← Back to kitOffline reference

Experiment 12 — REST API Client + Network Commands

Manual pages: 100–104 | Tools: Python + Windows Command Prompt

AIM

To create a simple REST API client in Python and analyze performance/connectivity using Ping, Traceroute and Netstat.

PART A — REST PROGRAM & EXECUTION

  1. Ensure Python installed; open terminal in this folder.
  2. python -m pip install requests (or install via requirements.txt from kit root).
  3. Run python rest_client.py, which makes GET to https://jsonplaceholder.typicode.com/posts/1 and prints HTTP status + JSON response.
  4. Internet connection required; exact JSON content may change or service may be unavailable. Code includes a friendly request-error message.

PARTS B–D — WINDOWS COMMAND EXECUTION

  1. Open Command Prompt.
  2. Ping: ping google.com → replies and round-trip times if reachable.
  3. Traceroute: tracert google.com → intermediate routers/hops (some may not respond).
  4. Netstat: netstat then netstat -an then netstat -ano → active connections, numeric endpoints, PID.
  5. Copy commands from WINDOWS_COMMANDS.txt.

EXPECTED OUTPUT

Status Code: 200
Response Data:
{'userId': 1, 'id': 1, 'title': '...', 'body': '...'}
PING: Reply from <IP> time=<ms>
TRACERT: hops 1, 2, 3, ...
NETSTAT: TCP/UDP endpoints; optional State and PID

RESULT

Thus, a REST API GET client was developed and network connectivity/path/connections were analyzed using Ping, Traceroute and Netstat.

VIVA