Package org.drasyl.handler.connection
Class TransmissionControlBlock
java.lang.Object
org.drasyl.handler.connection.TransmissionControlBlock
Send Sequence Space 1 2 3 4 ----------|----------|----------|---------- SND.UNA SND.NXT SND.UNA +SND.WND 1 - old sequence numbers which have been acknowledged 2 - sequence numbers of unacknowledged data 3 - sequence numbers allowed for new data transmission 4 - future sequence numbers which are not yet allowed
Receive Sequence Space 1 2 3 ----------|----------|---------- RCV.NXT RCV.NXT +RCV.WND 1 - old sequence numbers which have been acknowledged 2 - sequence numbers allowed for new reception 3 - future sequence numbers which are not yet allowed
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionlong
cwnd()
void
cwnd
(io.netty.channel.ChannelHandlerContext ctx, long newCwnd) void
delete()
int
int
The maximum size of a segment that TCP really sends, the "effective send MSS,"void
ensureLocalPortIsSelected
(int requestedLocalPort) boolean
int
hashCode()
void
void
long
irs()
Returns the initial receive sequence.void
irs
(long irs) long
iss()
Returns the initial sequence number.long
void
lastAckSent
(io.netty.channel.ChannelHandlerContext ctx, long newLastAckSent) long
void
lastAdvertisedWindow
(long lastAdvertisedWindow) int
long
long
rcvNxt()
Returns the sequence number of the next byte that the receiver is expecting to get from the sender.void
rcvNxt
(long rcvNxt) void
rcvNxt
(io.netty.channel.ChannelHandlerContext ctx, long newRcvNxt) long
rcvWnd()
Returns the receive window.int
void
remotePort
(int remotePort) void
int
rto()
void
rto
(io.netty.channel.ChannelHandlerContext ctx, int newRto) float
rttVar()
void
rttVar
(io.netty.channel.ChannelHandlerContext ctx, float newRttVar) void
long
sendMss()
int
smss()
RFC 5681: The SMSS is the size of the largest segment that the sender can transmit.long
sndNxt()
Returns the sequence number for the next byte of data that is to be sent.boolean
sndTsOk()
long
sndUna()
Returns the number of the oldest unacknowledged segment.long
sndUna
(io.netty.channel.ChannelHandlerContext ctx, long newSndUna) Returns the number of acked segments.long
sndWl1()
void
sndWl1
(long sndWl1) long
sndWl2()
void
sndWl2
(long sndWl2) long
sndWnd()
Returns the send window.void
sndWnd
(io.netty.channel.ChannelHandlerContext ctx, long newSndWnd) float
sRtt()
void
sRtt
(io.netty.channel.ChannelHandlerContext ctx, float newSRtt) long
ssthresh()
void
ssthresh
(io.netty.channel.ChannelHandlerContext ctx, long newSsthresh) state()
void
toString()
long
tsRecent()
void
tsRecent
(io.netty.channel.ChannelHandlerContext ctx, long newTsRecent) void
void
updateRcvWnd
(io.netty.channel.ChannelHandlerContext ctx)
-
Field Details
-
MIN_PORT
public static final int MIN_PORT- See Also:
-
MAX_PORT
public static final int MAX_PORT- See Also:
-
-
Method Details
-
state
-
state
-
sndUna
public long sndUna()Returns the number of the oldest unacknowledged segment. In other words, it is the sequence number of the first byte of data that has been sent, but not yet acknowledged by the receiver.- Returns:
- the number of the oldest unacknowledged segment
-
sndNxt
public long sndNxt()Returns the sequence number for the next byte of data that is to be sent.- Returns:
- the sequence number for the next byte of data that is to be sent
-
sndWnd
public long sndWnd()Returns the send window. It indicates the amount of free buffer space available at the receiver's end for incoming data. This value is communicated from the receiver to the sender, which allows the sender to adjust the data transmission rate accordingly.- Returns:
- the send window
-
iss
public long iss()Returns the initial sequence number. At the start of a new connection, both the peers randomly generate an initial sequence number, known as theiss()
, for their respective send sequences. This sequence number is used as the starting point for the sequence numbers assigned to the data bytes that are transmitted during the connection.- Returns:
- the initial sequence number
-
rcvNxt
public long rcvNxt()Returns the sequence number of the next byte that the receiver is expecting to get from the sender. After a segment is received and its data is successfully delivered to the receiving application,rcvNxt()
is incremented by the number of bytes received.- Returns:
- the sequence number of the next byte that the receiver is expecting to get from the sender
-
rcvWnd
public long rcvWnd()Returns the receive window. It represents the amount of data that the receiver is able to accept. This variable communicates the size of the available buffer space on the receiving end back to the sender, which allows the sender to understand how much data can be sent without overwhelming the receiver. It is updated each time the receiver sends an acknowledgement back to the sender.- Returns:
- the receive window
-
irs
public long irs()Returns the initial receive sequence. This is theiss()
received from the other side.- Returns:
- the initial receive sequence.
-
equals
-
hashCode
public int hashCode() -
toString
-
delete
public void delete() -
receiveBuffer
-
sendBuffer
-
sndWl1
public long sndWl1() -
sndWl2
public long sndWl2() -
cwnd
public long cwnd() -
outgoingSegmentQueue
-
retransmissionQueue
-
ssthresh
public long ssthresh() -
rcvNxt
public void rcvNxt(io.netty.channel.ChannelHandlerContext ctx, long newRcvNxt) -
updateRcvWnd
public void updateRcvWnd(io.netty.channel.ChannelHandlerContext ctx) -
maxSndWnd
public long maxSndWnd() -
effSndMss
public int effSndMss()The maximum size of a segment that TCP really sends, the "effective send MSS," -
smss
public int smss()RFC 5681: The SMSS is the size of the largest segment that the sender can transmit. This RFC 5681: value can be based on the maximum transmission unit of the network, the path MTU RFC 5681: discovery [RFC1191, RFC4821] algorithm, RMSS (see next item), or other factors. The RFC 5681: size does not include the TCP/IP headers and options. -
selectIss
public void selectIss() -
initSndUnaSndNxt
public void initSndUnaSndNxt() -
rto
public void rto(io.netty.channel.ChannelHandlerContext ctx, int newRto) -
tsRecent
public long tsRecent() -
sndUna
public long sndUna(io.netty.channel.ChannelHandlerContext ctx, long newSndUna) Returns the number of acked segments.- Parameters:
ctx
-newSndUna
-- Returns:
-
tsRecent
public void tsRecent(io.netty.channel.ChannelHandlerContext ctx, long newTsRecent) -
turnOnSndTsOk
public void turnOnSndTsOk() -
sRtt
public void sRtt(io.netty.channel.ChannelHandlerContext ctx, float newSRtt) -
rttVar
public void rttVar(io.netty.channel.ChannelHandlerContext ctx, float newRttVar) -
lastAckSent
public void lastAckSent(io.netty.channel.ChannelHandlerContext ctx, long newLastAckSent) -
sRtt
public float sRtt() -
rttVar
public float rttVar() -
rcvNxt
public void rcvNxt(long rcvNxt) -
irs
public void irs(long irs) -
sndTsOk
public boolean sndTsOk() -
lastAckSent
public long lastAckSent() -
rto
public int rto() -
ssthresh
public void ssthresh(io.netty.channel.ChannelHandlerContext ctx, long newSsthresh) -
cwnd
public void cwnd(io.netty.channel.ChannelHandlerContext ctx, long newCwnd) -
sendMss
public long sendMss() -
sndWnd
public void sndWnd(io.netty.channel.ChannelHandlerContext ctx, long newSndWnd) -
sndWl1
public void sndWl1(long sndWl1) -
sndWl2
public void sndWl2(long sndWl2) -
duplicateAcks
public int duplicateAcks() -
lastAdvertisedWindow
public void lastAdvertisedWindow(long lastAdvertisedWindow) -
incrementDuplicateAcks
public void incrementDuplicateAcks() -
resetDuplicateAcks
public void resetDuplicateAcks() -
lastAdvertisedWindow
public long lastAdvertisedWindow() -
localPort
public int localPort() -
remotePort
public void remotePort(int remotePort) -
remotePort
public int remotePort() -
ensureLocalPortIsSelected
public void ensureLocalPortIsSelected(int requestedLocalPort)
-