Fragmentation of TCP / UDP and Ethernet MTU

I read various websites and tutorials online, but I'm still confused. If the message is larger than the IP MTU, then the send()byte sent is returned. What happens to the rest of the message? Can I call again send()and try to send the rest of the message? Or is it that the IP layer should take care automatically?

+3
source share
2 answers

If you use TCP, then the interface presented to you is a stream of bytes. You do not need to worry about how a stream of bytes comes from one end of the connection to the other. You can ignore the IPU MTU. In fact, you can completely ignore the IP layer.

When you call send(), the TCP stack on your computer will handle all the details necessary for the byte stream that you click on your send calls to appear from calls recv()on the other end of the connection.

, TCP , , send() recv(), send() recv(). . , recv() 1 , ( , recv()).

;)

TCP send(), , , TCP () TCP , , , , . TCP-, send() - MTU, , slimmed down ...

, send() , , , - . send() , , , , , , , , ...

, .

+6

, ICMP , .

TCP, , , . , IP , , MTU , , .

WRT UDP, , , UDP, . , , , MTU.

... send() -, WRT . , 100 ... send() 10 . 90 , , .

Windows send() , . .. Linux . .

0

Source: https://habr.com/ru/post/1736072/


All Articles