Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/abhinavrobinson/rust-tcp-rfc-793
RFC 793 "TCP" Impl in Rust [education purpose only]
https://github.com/abhinavrobinson/rust-tcp-rfc-793
network-programming rust tcp
Last synced: 5 days ago
JSON representation
RFC 793 "TCP" Impl in Rust [education purpose only]
- Host: GitHub
- URL: https://github.com/abhinavrobinson/rust-tcp-rfc-793
- Owner: AbhinavRobinson
- Created: 2024-08-30T05:36:14.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-09-07T09:45:13.000Z (4 months ago)
- Last Synced: 2024-09-07T10:24:08.140Z (4 months ago)
- Topics: network-programming, rust, tcp
- Language: Rust
- Homepage:
- Size: 247 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# RFC 793 (TCP) implementation in Rust
Handles TCP States:
```
[X] SYN
[ ] ACK
[ ] FIN
[ ] ...rest of tcp state
```(Educational Purpose Only) Current version of program responds to IPv4 SYN packets and is able to recieve successful ACK packets from sender (netcat).
![Get ACK Packet](/_artifacts/get_ack.png?raw=true "Get ACK Packet from Netcat")
State Diagram:
```
Transmission Control Protocol
Functional Specification+---------+ ---------\ active OPEN
| CLOSED | \ -----------
+---------+<---------\ \ create TCB
| ^ \ \ snd SYN
passive OPEN | | CLOSE \ \
------------ | | ---------- \ \
create TCB | | delete TCB \ \
V | \ \
+---------+ CLOSE | \
| LISTEN | ---------- | |
+---------+ delete TCB | |
rcv SYN | | SEND | |
----------- | | ------- | V
+---------+ snd SYN,ACK / \ snd SYN +---------+
| |<----------------- ------------------>| |
| SYN | rcv SYN | SYN |
| RCVD |<-----------------------------------------------| SENT |
| | snd ACK | |
| |------------------ -------------------| |
+---------+ rcv ACK of SYN \ / rcv SYN,ACK +---------+
| -------------- | | -----------
| x | | snd ACK
| V V
| CLOSE +---------+
| ------- | ESTAB |
| snd FIN +---------+
| CLOSE | | rcv FIN
V ------- | | -------
+---------+ snd FIN / \ snd ACK +---------+
| FIN |<----------------- ------------------>| CLOSE |
| WAIT-1 |------------------ | WAIT |
+---------+ rcv FIN \ +---------+
| rcv ACK of FIN ------- | CLOSE |
| -------------- snd ACK | ------- |
V x V snd FIN V
+---------+ +---------+ +---------+
|FINWAIT-2| | CLOSING | | LAST-ACK|
+---------+ +---------+ +---------+
| rcv ACK of FIN | rcv ACK of FIN |
| rcv FIN -------------- | Timeout=2MSL -------------- |
| ------- x V ------------ x V
\ snd ACK +---------+delete TCB +---------+
------------------------>|TIME WAIT|------------------>| CLOSED |
+---------+ +---------+TCP Connection State Diagram
```