How to Use
Step-by-step guide to download and use CN Lab experiments
1. Open Terminal
Open your terminal (Terminal, Command Prompt, PowerShell, etc.).
2. Navigate to Desktop
Go to your Desktop folder:
cd ~/DesktopWindows: cd %USERPROFILE%\Desktop
3. Create a Folder
Create a new folder to store your CN Lab files:
mkdir cn-labWindows: same
4. Enter the Folder
Go into the newly created folder:
cd cn-labWindows: same
5. Download the File
Now download experiment 06:
curl -L -OJL https://cn.ufraan.dev/api/g/06See 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.cWindows: 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-servergcc udp-client.c -o udp-clientWindows: install MinGW or use WSL
9. Run
Open two terminal windows:
Terminal 1 (Server):
./udp-serverTerminal 2 (Client):
./udp-clientSee example below: (click to expand)