A stack which works with or without an Mbed os library. Provides IPv4 or IPv6 with a full 1500 byte buffer.
Dependents: oldheating gps motorhome heating
tcp/tcp.txt@79:f50e02fb5c94, 2018-11-11 (annotated)
- Committer:
- andrewboyson
- Date:
- Sun Nov 11 15:44:23 2018 +0000
- Revision:
- 79:f50e02fb5c94
- Parent:
- 75:603b10404183
Added RTO support to TCP and fixed a problem with polling of different IP versions.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
andrewboyson | 71:736a5747ade1 | 1 | Names |
andrewboyson | 71:736a5747ade1 | 2 | ===== |
andrewboyson | 71:736a5747ade1 | 3 | ISN == Initial Sequence Number |
andrewboyson | 71:736a5747ade1 | 4 | SEQ num == Sequence Number is the sequence of the first byte of the sent data packet - unless a SYN in which case it is the ISN |
andrewboyson | 71:736a5747ade1 | 5 | ACK num == Acknowledge Number is the next sequence number that the sender of the ACK is expecting |
andrewboyson | 71:736a5747ade1 | 6 | TCB == Transmission Control Block |
andrewboyson | 71:736a5747ade1 | 7 | RTO == Retransmission Time Out |
andrewboyson | 71:736a5747ade1 | 8 | |
andrewboyson | 75:603b10404183 | 9 | Only received packets with a sequence of 1 (position == 0) is handled; any others are ignored. This works because we only handle the first line. |
andrewboyson | 75:603b10404183 | 10 | |
andrewboyson | 75:603b10404183 | 11 | From RFC793 |
andrewboyson | 75:603b10404183 | 12 | Reset Processing |
andrewboyson | 71:736a5747ade1 | 13 | |
andrewboyson | 75:603b10404183 | 14 | In all states except SYN-SENT, all reset (RST) segments are validated |
andrewboyson | 75:603b10404183 | 15 | by checking their SEQ-fields. A reset is valid if its sequence number |
andrewboyson | 75:603b10404183 | 16 | is in the window. In the SYN-SENT state (a RST received in response |
andrewboyson | 75:603b10404183 | 17 | to an initial SYN), the RST is acceptable if the ACK field |
andrewboyson | 75:603b10404183 | 18 | acknowledges the SYN. |
andrewboyson | 71:736a5747ade1 | 19 | |
andrewboyson | 75:603b10404183 | 20 | The receiver of a RST first validates it, then changes state. If the |
andrewboyson | 75:603b10404183 | 21 | receiver was in the LISTEN state, it ignores it. If the receiver was |
andrewboyson | 75:603b10404183 | 22 | in SYN-RECEIVED state and had previously been in the LISTEN state, |
andrewboyson | 75:603b10404183 | 23 | then the receiver returns to the LISTEN state, otherwise the receiver |
andrewboyson | 75:603b10404183 | 24 | aborts the connection and goes to the CLOSED state. If the receiver |
andrewboyson | 75:603b10404183 | 25 | was in any other state, it aborts the connection and advises the user |
andrewboyson | 79:f50e02fb5c94 | 26 | and goes to the CLOSED state. |
andrewboyson | 79:f50e02fb5c94 | 27 | |
andrewboyson | 79:f50e02fb5c94 | 28 | Retransmission Timer – To retransmit lost segments, TCP uses retransmission timeout (RTO). |
andrewboyson | 79:f50e02fb5c94 | 29 | When TCP sends a segment the timer starts and stops when the acknowledgment is received. |
andrewboyson | 79:f50e02fb5c94 | 30 | If the timer expires timeout occurs and the segment is retransmitted. |
andrewboyson | 79:f50e02fb5c94 | 31 | The timer 'SendsBeingAcked' is reset whenever: |
andrewboyson | 79:f50e02fb5c94 | 32 | tcprecv - a packet is received where the ack counter has advanced; |
andrewboyson | 79:f50e02fb5c94 | 33 | tcpsend - the ack count received is the same as the seq count sent |
andrewboyson | 79:f50e02fb5c94 | 34 | tcpsend - resent the last unacked packet |