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.