It is indeed for a certain field. A one-byte field does not matter the byte order, so only fields with more than double bytes have byte order problems. Convert a multi-byte field to network byte order when assembling a data packet. After a data packet is assembled, the packet looks like this, and it also looks like this when transmitted on the network. When the data reaches the destination, the fields need to be converted into the byte order of the own host for parsing
The reverse will only occur when a host with a different byte order than the network sends multi-byte fields
If you have ever written a network program you will understand. The simplest one can be to write a ping program using raw sockets, which will use packet assembly and have multi-byte fields
It is indeed for a certain field. A one-byte field does not matter the byte order, so only fields with more than double bytes have byte order problems. Convert a multi-byte field to network byte order when assembling a data packet. After a data packet is assembled, the packet looks like this, and it also looks like this when transmitted on the network. When the data reaches the destination, the fields need to be converted into the byte order of the own host for parsing
The reverse will only occur when a host with a different byte order than the network sends multi-byte fields
If you have ever written a network program you will understand. The simplest one can be to write a ping program using raw sockets, which will use packet assembly and have multi-byte fields