This repository contains solutions to four major network programming assignments from KAIST's EE323 Computer Networks course. The assignments progressively build an understanding of socket programming, application-layer protocols, network-layer routing, and transport-layer reliability.
Goal: Implement a simple server that accepts TCP connections and echoes client messages line by line.
- ✅ Each client runs in its own process (via
fork()). - ✅ Message is transmitted upon pressing
Enter. - ✅ Double
Entertriggers client exit. - ✅ Command-line interface using
getopt()(-p,-h). - ✅ Compatible with file redirection and piping (
< input.txt,> output.txt).
Files:
server.cclient.cMakefile
Run:
# Server
$ ./server -p 12345
# Client
$ ./client -p 12345 -h 127.0.0.1Goal: Build a multi-client HTTP/1.0 proxy server supporting basic caching and blacklisting.
- ✅ Accepts requests, forwards them to destination servers, returns responses.
- ✅ Parses HTTP requests (method, URL, host).
- ✅ Filters blacklisted domains and redirects to
http://warning.or.kr. - ✅ Can be tested with browser, telnet, or Python script.
- ✅ Properly handles malformed requests with HTTP 400.
Files:
proxy.cMakefile
Run:
$ ./proxy <PORT> < blacklist.txtTest (example):
$ telnet localhost <PORT>
GET http://example.com/ HTTP/1.0
Host: example.comGoal: Simulate a software router that performs routing, ARP handling, ICMP response, and packet forwarding in a Mininet-emulated network.
- ✅ Responds to ARP requests and maintains ARP cache.
- ✅ Responds to ICMP Echo Requests and Time Exceeded (Traceroute).
- ✅ Filters packets from blacklisted subnets (10.0.2.0/24).
- ✅ Drops packets with unresolved ARP after timeout, replies with ICMP Unreachable.
- ✅ Fully tested using Mininet and POX SDN controller.
Files:
router/sr_router.crouter/sr_arpcache.crouter/Makefile
Run (inside VM):
$ ./run_pox.sh
$ ./run_mininet.sh
$ ./srGoal: Implement a simplified TCP-like transport protocol called STCP.
- ✅ Three-way handshake (SYN/SYN-ACK/ACK)
- ✅ Four-way connection teardown (FIN/ACK)
- ✅ In-order, reliable, full-duplex transmission
- ✅ Sliding window with slow start
- ✅ Logging transmission statistics (
client_log.txt,server_log.txt) - ✅ Compatible with
mysockinterface (provided stub)
Files:
transport.c(ONLY file modified)- Compiles with provided
Makefile
Run:
# Server
$ ./server
# Client
$ ./client <SERVER_IP>:<PORT> -f testfile.txtOutput:
- File
rcvdis saved at the client side. - Logs are saved in the root directory.
Each assignment contains a Makefile. Run:
$ makeTo clean:
$ make clean⚠ All code is tested and compiled on KAIST lab machines (
eelab5,eelab6). Behavior may vary on other environments.
- Beej’s Guide to Network Programming
- RFC 793 – Transmission Control Protocol
- RFC 1945 – HTTP/1.0 Specification
- Mininet & POX documentation
Do not reuse or redistribute this repository for academic credit. This work is intended for educational reference and self-study only.