Skip to content

ENuel20/trust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Trust - TCP Implementation

This is a TCP implementation based on RFC 793 https://www.rfc-editor.org/rfc/rfc793.html

How to Run

Step 1: Start the Server

In one terminal, run the server script:

./run.sh

The server will start and listen for TCP connections on the tun0 interface. image

Step 2: Monitor Network Traffic with tshark

In another terminal, set up tshark to view the network handshake and TCP metrics:

sudo tshark -i tun0

This will capture and display all network packets on the tun0 interface, allowing you to see the TCP handshake and communication details. image

Step 3: Test the Connection

in another terminal You can test the server with either of these approaches:

Option 1: Send a Single Message (One Packet)

echo "foo" | nc 192.168.0.2 8000

Expected output:

hello from rust-tcp!

This sends "foo" to the server, which reads it and closes the connection immediately.

Option 2: Interactive Connection (Multiple Packets)

nc 192.168.0.2 8000

Then type messages interactively:


read
write to me
ok good job
image

Key Differences

  • Option 1: Sends a single message. The server reads it and stops immediately. This results in minimal packet exchange.

Learning Resources

Follow this learning path to understand the implementation:

Phase 1: Protocol Overview & Fundamentals

  1. RFC 1180 - TCP/IP Protocol Suite Tutorial (Overview)

  2. YouTube: TCP Trace Files & Packet Analysis (Video)

  3. YouTube: TCP Deep Dive (Video)

Phase 2: Main Implementation Reference (Core)

RFC 793 - Transmission Control ProtocolMAIN REFERENCE

Phase 3: Supplementary

  1. RFC 791 - Internet Protocol (Optional)

  2. YouTube: TCP Retransmission (Advanced)

About

implementation of TCP/IP

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors