Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rfc9293 WIP #202

Open
wants to merge 40 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1113751
tcp: Remove redundant :ack-p t
ebrasca Feb 19, 2024
3b0fe68
tcp: Update the protocol specification link to rfc9293
ebrasca Feb 25, 2024
ef54dfb
tcp: Do nothing to finish segments when in state :closed or :listen
ebrasca Feb 25, 2024
c140f05
tcp: Fix errata
ebrasca Feb 25, 2024
d2c3874
tcp: Refactor acceptable-segment-p
ebrasca Feb 25, 2024
8c0a1c1
tcp: Add tcp4-send-ack
ebrasca Mar 20, 2024
e8b7f35
tcp: Add challenge-ack
ebrasca Mar 20, 2024
0e6ca64
tcp: Check the sequence numbers before accepting RST in :syn-sent
ebrasca Mar 20, 2024
bce312d
tcp: Send RST when package is from old connection in :syn-sent state
ebrasca Mar 20, 2024
fb4e215
tcp: Refactor tcp4-connection-receive :syn-sent state
ebrasca Mar 20, 2024
e91e108
tcp: ACK non RST incoming unacceptable segments
ebrasca Mar 20, 2024
5a6d095
tcp: Check incomming RST segments
ebrasca Mar 20, 2024
53363c9
tcp: Don't abort connection when resiving segment in :syn-received state
ebrasca Mar 20, 2024
cc921f7
tcp: Remove connection from listener when getting SYN in state :syn-r…
ebrasca Mar 20, 2024
d602981
tcp: Challenge any SYN segment when not in :syn-sent state
ebrasca Mar 20, 2024
352172c
tcp: Add :time-wait state
ebrasca Mar 20, 2024
663c799
tcp: Add =<
ebrasca Mar 22, 2024
9688f25
tcp: Deal with wrap around sequence numbers correctly
ebrasca Mar 22, 2024
08e01fb
tcp: Small refactor
ebrasca Mar 22, 2024
f6fa477
tcp: Send RST to segments of old connections in :syn-received state
ebrasca Mar 22, 2024
3278434
tcp: Handle FIN in :syn-received state
ebrasca Mar 22, 2024
180b7b4
tcp: Chenck ACK sequence number in :last-ack state before ending it
ebrasca Mar 22, 2024
3334d79
tcp: Hangle FIN in :last-ack state
ebrasca Mar 22, 2024
0c28348
tcp: Ignore SYN or RST packets without ACK
ebrasca Mar 22, 2024
c9a2b0d
tcp: Allow sending data in half open connection
ebrasca Mar 22, 2024
d4bf137
tcp: Add rfc5961 mitigation
ebrasca Mar 22, 2024
98af636
tcp: Send ACK to segments that acknowledges something not yet sent
ebrasca Mar 22, 2024
bfb920a
tcp: Hangle FIN in :closing state
ebrasca Mar 22, 2024
dd95347
tcp: Hangle FIN in :close-wait state
ebrasca Mar 23, 2024
0d07fa7
tcp: Allow to resive data and control in the same segment
ebrasca Mar 23, 2024
5a15692
tcp: Refactor tcp4-connection-receive :fin-wait-1 state
ebrasca Mar 23, 2024
7cf7956
tcp: Update window size
ebrasca Mar 27, 2024
b365915
arp: Use correct function to get the time
ebrasca Jul 1, 2024
4f2bd69
tcp: Report connection-closing in tcp-send when connetion is closing
ebrasca Jul 1, 2024
c229bc9
tcp: Implemented abort close
ebrasca Jul 1, 2024
24ea270
tcp: Refactor tcp-send
ebrasca Jul 9, 2024
94ebcb6
tcp: Add missing :closed case
ebrasca Jul 9, 2024
dc3eced
tcp: Implemented time-wait timeout
ebrasca Jul 10, 2024
1690e24
tcp: Add :closed case to tcp4-connection-receive
ebrasca Jul 12, 2024
fe6ae64
tcp: Add close for :syn-sent and :syn-received cases
ebrasca Jul 12, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions net/tcp.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -490,16 +490,15 @@ Set to a value near 2^32 to test SND sequence number wrapping.")
(defun tcp-packet-data-length (packet start end)
(- end (+ start (tcp-packet-header-length packet start end))))

(defun acceptable-segment-p (connection packet start end)
(defun acceptable-segment-p (connection seg.seq seg.len)
(let ((rcv.wnd (tcp-connection-rcv.wnd connection))
(rcv.nxt (tcp-connection-rcv.nxt connection))
(seg.seq (tcp-packet-sequence-number packet start end))
(seg.len (tcp-packet-data-length packet start end)))
(rcv.nxt (tcp-connection-rcv.nxt connection)))
(if (eql rcv.wnd 0)
(and (eql seg.len 0)
(eql seg.seq rcv.nxt))
;; Arithmetic here is not wrapping, so as to avoid wrap-around problems.
(and (and (<= rcv.nxt seg.seq) (< seg.seq (+ rcv.nxt rcv.wnd)))
(and (<= rcv.nxt seg.seq)
fitzsim marked this conversation as resolved.
Show resolved Hide resolved
(< seg.seq (+ rcv.nxt rcv.wnd))
(or (eql seg.len 0)
(let ((seq-end (+ seg.seq seg.len -1)))
(and (<= rcv.nxt seq-end) (< seq-end (+ rcv.nxt rcv.wnd)))))))))
Expand Down Expand Up @@ -626,7 +625,7 @@ Set to a value near 2^32 to test SND sequence number wrapping.")
(remhash connection (tcp-listener-pending-connections listener))
(decf (tcp-listener-n-pending-connections listener))))))
(:established
(cond ((not (acceptable-segment-p connection packet start end))
(cond ((not (acceptable-segment-p connection seq data-length))
(when (not (logtest flags +tcp4-flag-rst+))
(tcp4-send-packet connection
(tcp-connection-snd.nxt connection)
Expand Down