How to Use

Step-by-step guide to download and use CN Lab experiments

← Go back
Note: This example is for experiment 06. File names, code sections, and compile/run commands may differ for other experiments. Refer to the downloaded .txt file for exact instructions.

1. Open Terminal

Open your terminal (Terminal, Command Prompt, PowerShell, etc.).

2. Navigate to Desktop

Go to your Desktop folder:

cd ~/Desktop

Windows: cd %USERPROFILE%\Desktop

3. Create a Folder

Create a new folder to store your CN Lab files:

mkdir cn-lab

Windows: same

4. Enter the Folder

Go into the newly created folder:

cd cn-lab

Windows: same

5. Download the File

Now download experiment 06:

curl -L -OJL https://cn.ufraan.dev/api/g/06

See example: (click to expand)

6. Extract the Contents

The downloaded file is exp06.txt. It contains complete C programs with server and client code.

Inside, you'll find sections like:

  • SERVER CODE - Save as udp-server.c
  • CLIENT CODE - Save as udp-client.c
  • HOW TO COMPILE AND RUN - Instructions

7. Create Files

Create two files and paste the respective code:

touch udp-server.c udp-client.c

Windows: create files in Notepad

Then open each file and paste the code from exp06.txt

8. Compile

Compile both files:

gcc udp-server.c -o udp-server
gcc udp-client.c -o udp-client

Windows: install MinGW or use WSL

9. Run

Open two terminal windows:

Terminal 1 (Server):

./udp-server

Terminal 2 (Client):

./udp-client

See example below: (click to expand)