Skip to content

Conversation

@lol-fi
Copy link
Contributor

@lol-fi lol-fi commented Apr 10, 2019

No description provided.

@heaventourist
Copy link
Contributor

We don't have a window field in the packet, how are we supposed to inform the sender how many bytes the receiver is about to accept? Also, if we set the maximum packet size to be a certain number, what should we do if the data size is more than the maximum packet size? Fragment it? Can anyone explain it?

@lol-fi
Copy link
Contributor Author

lol-fi commented Apr 10, 2019

You know the window as spec'd in the PRFC. So you have 65,???. You send a packet of 4k. 65,???-4k = 61k. That's how much you have remaining to send. When you get an ack for that packet you have 65??? window left to send.

If someone sends something bigger than the max packet size, you just accept it. It's just a recommendation. But people might not want to do that because then the network will be dropping a lot of their packets, which is annoying. The bigger the packets, the more will be dropped.

So if you sent a 6k packet, you have 65,???-6k left to send, so you have 59k more than left. The window is static so you can just do math based on what you send

@heaventourist
Copy link
Contributor

You know the window as spec'd in the PRFC. So you have 65,???. You send a packet of 4k. 65,???-4k = 61k. That's how much you have remaining to send. When you get an ack for that packet you have 65??? window left to send.

If someone sends something bigger than the max packet size, you just accept it. It's just a recommendation. But people might not want to do that because then the network will be dropping a lot of their packets, which is annoying. The bigger the packets, the more will be dropped.

So if you sent a 6k packet, you have 65,???-6k left to send, so you have 59k more than left. The window is static so you can just do math based on what you send

So if the application layer needs to send data which size is more than the maximum size we specified, the protocol layer just accept it and sent to the other side? Then what is the meaning of specifying the maximum size? Just to remind the user that you'd better send less than this limit, otherwise, your delivery is not guaranteed?

@lol-fi
Copy link
Contributor Author

lol-fi commented Apr 11, 2019

You are supposed to split it into multiple packets and send as many packets as you can, with the data adding up to the amount that will be accepted in the window. If you have more than will fit in the window, you need to wait for some acks

@heaventourist
Copy link
Contributor

You are supposed to split it into multiple packets and send as many packets as you can, with the data adding up to the amount that will be accepted in the window. If you have more than will fit in the window, you need to wait for some acks

Then the difficulty comes. We don't have those fields like in ip layer. We don't have fragment offset and those flags, how are we supposed to know which packet is the end of the original packet before fragmentation. Even if we want to send a content length, we are not guaranteed that all the packets are received in order.

@lol-fi
Copy link
Contributor Author

lol-fi commented Apr 11, 2019

What do you mean? You just read all the content in the data field from each packet...you know what is missing from segment numbers...you have to wait for the segments to come in order before passing up...I'm not sure what is the problem here

@heaventourist
Copy link
Contributor

What do you mean? You just read all the content in the data field from each packet...you know what is missing from segment numbers...you have to wait for the segments to come in order before passing up...I'm not sure what is the problem here

How are you supposed to send the "segment number" to the receiver? We don't have this field in the packet.

@lol-fi
Copy link
Contributor Author

lol-fi commented Apr 11, 2019

Sequence number

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants