# zemarinho/rcom-feup architecture

> Architecture diagram of the GitHub repository zemarinho/rcom-feup, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-16). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/zemarinho/rcom-feup
- Repository: https://github.com/zemarinho/rcom-feup

## Overview

This repository is a collection of FEUP computer-networking coursework: serial-link transfer exercises and virtual-cable tooling in Projeto1, plus FTP/TCP client exercises and network-lab configuration in Projeto2. The serial workflow sends file data through link-layer framing and receives/reassembles it; the FTP client parses a URL, connects, logs in, then lists or downloads. Source excerpts show the cable’s virtual-port setup and the FTP/TCP client behavior, but do not establish wiring between the serial programs and cable. Project2’s README contains no capability detail, so the lab materials are represented conservatively.

Main entry points: [`Projeto1/Trabalho_FSilva_JMarinho/write_noncanonical.c`](https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Trabalho_FSilva_JMarinho/write_noncanonical.c) (Serial Sender), [`Projeto1/Trabalho_FSilva_JMarinho/cable.c`](https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Trabalho_FSilva_JMarinho/cable.c) (Virtual Cable), [`Projeto2/Trabalho_FSilva_JMarinho/clientFTP.c`](https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/clientFTP.c) (FTP Client), [`Projeto2/Trabalho_FSilva_JMarinho/clientTCP.c`](https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/clientTCP.c) (TCP Demo Client)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_serial["Serial Transfer"]
  node_serial_sender["Serial Sender"]
  node_serial_receiver["Serial Receiver"]
  node_canonical_io["Canonical I/O<br/>[read_canonical.c]"]
  node_reference_sender["Reference Writer"]
  node_virtual_cable["Virtual Cable<br/>[cable.c]"]
end

subgraph group_network["Network Clients"]
  node_ftp_client["FTP Client<br/>[clientFTP.c]"]
  node_tcp_client["TCP Demo Client<br/>[clientTCP.c]"]
  node_dns_lookup["Host Lookup<br/>[getip.c]"]
end

subgraph group_lab["Network Lab"]
  node_network_setup["Topology Setup"]
  node_lab_notes["Lab Records<br/>[Respostas_1_3.md]"]
  node_packet_captures["Packet Captures"]
end

node_user(("Operator"))
node_socat["PTY Provider"]
node_ftp_server["FTP Server"]
node_tcp_server["TCP Server"]
node_dns_service["DNS Resolver"]

node_user -->|"starts transfer"| node_serial_sender
node_user -->|"starts receive"| node_serial_receiver
node_serial_sender -.->|"sends frames"| node_serial_receiver
node_user -->|"starts cable"| node_virtual_cable
node_virtual_cable -->|"creates PTYs"| node_socat
node_user -->|"provides URL"| node_ftp_client
node_ftp_client -->|"FTP commands"| node_ftp_server
node_user -->|"starts demo"| node_tcp_client
node_tcp_client -->|"sends message"| node_tcp_server
node_user -->|"provides hostname"| node_dns_lookup
node_dns_lookup -->|"resolves host"| node_dns_service

click node_serial_sender "https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Trabalho_FSilva_JMarinho/write_noncanonical.c"
click node_serial_receiver "https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Trabalho_FSilva_JMarinho/read_noncanonical.c"
click node_canonical_io "https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Referencia1/read_canonical.c"
click node_reference_sender "https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Referencia1/write_noncanonical.c"
click node_virtual_cable "https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Trabalho_FSilva_JMarinho/cable.c"
click node_ftp_client "https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/clientFTP.c"
click node_tcp_client "https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/clientTCP.c"
click node_dns_lookup "https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/getip.c"
click node_network_setup "https://github.com/zemarinho/rcom-feup/tree/main/Projeto2/Trabalho_FSilva_JMarinho/Auto_Setup"
click node_lab_notes "https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/Respostas_1_3.md"
click node_packet_captures "https://github.com/zemarinho/rcom-feup/tree/main/Projeto2/WireSharkLogs"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_serial_sender,node_serial_receiver,node_canonical_io,node_reference_sender,node_virtual_cable toneBlue
class node_ftp_client,node_tcp_client,node_dns_lookup toneAmber
class node_network_setup,node_lab_notes,node_packet_captures,node_ftp_server,node_tcp_server toneMint
class node_user,node_socat,node_dns_service toneIndigo
```

## Components

### Serial Transfer

- [Serial Sender](https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Trabalho_FSilva_JMarinho/write_noncanonical.c): `Projeto1/Trabalho_FSilva_JMarinho/write_noncanonical.c`
- [Serial Receiver](https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Trabalho_FSilva_JMarinho/read_noncanonical.c): `Projeto1/Trabalho_FSilva_JMarinho/read_noncanonical.c`
- [Canonical I/O](https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Referencia1/read_canonical.c): `Projeto1/Referencia1/read_canonical.c`
- [Reference Writer](https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Referencia1/write_noncanonical.c): `Projeto1/Referencia1/write_noncanonical.c`
- [Virtual Cable](https://github.com/zemarinho/rcom-feup/blob/main/Projeto1/Trabalho_FSilva_JMarinho/cable.c): `Projeto1/Trabalho_FSilva_JMarinho/cable.c`

### Network Clients

- [FTP Client](https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/clientFTP.c): `Projeto2/Trabalho_FSilva_JMarinho/clientFTP.c`
- [TCP Demo Client](https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/clientTCP.c): `Projeto2/Trabalho_FSilva_JMarinho/clientTCP.c`
- [Host Lookup](https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/getip.c): `Projeto2/Trabalho_FSilva_JMarinho/getip.c`

### Network Lab

- [Topology Setup](https://github.com/zemarinho/rcom-feup/tree/main/Projeto2/Trabalho_FSilva_JMarinho/Auto_Setup): `Projeto2/Trabalho_FSilva_JMarinho/Auto_Setup`
- [Lab Records](https://github.com/zemarinho/rcom-feup/blob/main/Projeto2/Trabalho_FSilva_JMarinho/Respostas_1_3.md): `Projeto2/Trabalho_FSilva_JMarinho/Respostas_1_3.md`
- [Packet Captures](https://github.com/zemarinho/rcom-feup/tree/main/Projeto2/WireSharkLogs): `Projeto2/WireSharkLogs`

### Other components

- **Operator**
- **PTY Provider**
- **FTP Server**
- **TCP Server**
- **DNS Resolver**

## Connections

- Operator → Serial Sender: starts transfer (evidence: `Projeto1/Trabalho_FSilva_JMarinho/write_noncanonical.c`)
- Operator → Serial Receiver: starts receive (evidence: `Projeto1/Trabalho_FSilva_JMarinho/read_noncanonical.c`)
- Serial Sender → Serial Receiver: sends frames
- Operator → Virtual Cable: starts cable (evidence: `Projeto1/Trabalho_FSilva_JMarinho/cable.c`)
- Virtual Cable → PTY Provider: creates PTYs (evidence: `Projeto1/Trabalho_FSilva_JMarinho/cable.c`)
- Operator → FTP Client: provides URL (evidence: `Projeto2/Trabalho_FSilva_JMarinho/clientFTP.c`)
- FTP Client → FTP Server: FTP commands (evidence: `Projeto2/Trabalho_FSilva_JMarinho/clientFTP.c`)
- Operator → TCP Demo Client: starts demo (evidence: `Projeto2/Trabalho_FSilva_JMarinho/clientTCP.c`)
- TCP Demo Client → TCP Server: sends message (evidence: `Projeto2/Trabalho_FSilva_JMarinho/clientTCP.c`)
- Operator → Host Lookup: provides hostname (evidence: `Projeto2/Trabalho_FSilva_JMarinho/getip.c`)
- Host Lookup → DNS Resolver: resolves host (evidence: `Projeto2/Trabalho_FSilva_JMarinho/getip.c`)
