|
|
|
|
||||||
| comp.protocols.tcp-ip TCP and IP network protocols. |
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hello!
I'm confused about UDP checksum when being disabled. The book, "Data communication and Networking, 4th edition, Forouzan", said ---> "If the checksum is not calculated, the field is filled with 1s. Note that a calculated checksum can never be all 1s because this implies that the sum is all 0s, which is impossible because it requires that the value of fields to be 0s..." , p.712 When UDP checksum disabled, the field is filled with 0xFFFF. I think this is logically right!! If the checksum field to be all 1s, the sum of all field must be 0, which means, all fields must be 0. Impossible... But!! the rfc768.txt said ---> "If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic). An all zero transmitted checksum value means that the transmitter generated no checksum (for debugging or for higher level protocols that don't care). " When UDP checksum disabled, the filed is filled with 0x0000 Two documents say oppositely each other. Which of them is right?? If as above, Normally computed checksum field value could be 0. but it would be considered as "disabled mode".... I think the book DCN is right. because considering the way of checkum calculation, it is logically right. but RFC!! Maybe the checksum's meanning of the RFC sentences, the one before 1's complement computation??? Please me~ |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
<khsharpy@gmail.com> wrote:
> I'm confused about UDP checksum when being disabled. > > The book, "Data communication and Networking, 4th edition, Forouzan", > said > ---> > "If the checksum is not calculated, the field is filled with 1s. Note > that a calculated checksum can never be all 1s because this implies > that the sum is all 0s, which is impossible because it requires that > the value of fields to be 0s..." , p.712 > > When UDP checksum disabled, the field is filled with 0xFFFF. > > I think this is logically right!! If the checksum field to be all 1s, > the sum of all field must be 0, which means, all fields must be 0. > Impossible... The RFC that describes UDP is RFC 768. As you point out, the checksum field is to be used as follows: "If the computed checksum is zero, it is transmitted as all ones (the equivalent in one's complement arithmetic). An all zero transmitted checksum value means that the transmitter generated no checksum (for debugging or for higher level protocols that don't care)." The RFC is the document to go by. In one's complement, all 1s or all 0s are both used to denote 0. The RFC makes use of this fact, and stipulates that all 0s should NOT be used as a valid checksum value, but rather to indicate that the checksum is not being used. In the real world, it actually does work this way. Bert |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
In article <1178093809.545231.302190@h2g2000hsg.googlegroups. com>,
khsharpy@gmail.com wrote: > Hello! > > I'm confused about UDP checksum when being disabled. > > The book, "Data communication and Networking, 4th edition, Forouzan", > said > ---> > "If the checksum is not calculated, the field is filled with 1s. Note > that a calculated checksum can never be all 1s because this implies > that the sum is all 0s, which is impossible because it requires that > the value of fields to be 0s..." , p.712 > > When UDP checksum disabled, the field is filled with 0xFFFF. > > I think this is logically right!! If the checksum field to be all 1s, > the sum of all field must be 0, which means, all fields must be 0. > Impossible... > > > But!! > > the rfc768.txt said > ---> > "If the computed checksum is zero, it is transmitted as all ones (the > equivalent in one's complement arithmetic). An all zero transmitted > checksum value means that the transmitter generated no checksum (for > debugging or for higher level protocols that don't care). " > > When UDP checksum disabled, the filed is filled with 0x0000 > > Two documents say oppositely each other. > > Which of them is right?? The RFC is correct. RFC 1122 restates it: IMPLEMENTATION: There is a common implementation error in UDP checksums. Unlike the TCP checksum, the UDP checksum is optional; the value zero is transmitted in the checksum field of a UDP header to indicate the absence of a checksum. If the transmitter really calculates a UDP checksum of zero, it must transmit the checksum as all 1's (65535). No special action is required at the receiver, since zero and 65535 are equivalent in 1's complement arithmetic. > > > If as above, Normally computed checksum field value could be 0. but it > would be considered as "disabled mode".... > > I think the book DCN is right. because considering the way of checkum > calculation, it is logically right. > > but RFC!! > > > Maybe the checksum's meanning of the RFC sentences, the one before 1's > complement computation??? When the RFC says "the computed checksum", it refers to the final value AFTER performing the one's complement of the sum of all the bytes. So if the ordinary sum is 0xffff, the computed checksum will be 0x0000. The RFC then says that this should be transmitted as 0xffff. There's no ambiguity because the ordinary sum can never be 0x0000. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
|
|
#4 |
|
Messages: n/a
Hébergeur: |
On May 3, 9:06 am, Barry Margolin <bar...@alum.mit.edu> wrote:
> In article <1178093809.545231.302...@h2g2000hsg.googlegroups. com>, > > > > > > khsha...@gmail.com wrote: > > Hello! > > > I'm confused about UDP checksum when being disabled. > > > The book, "Data communication and Networking, 4th edition, Forouzan", > > said > > ---> > > "If the checksum is not calculated, the field is filled with 1s. Note > > that a calculated checksum can never be all 1s because this implies > > that the sum is all 0s, which is impossible because it requires that > > the value of fields to be 0s..." , p.712 > > > When UDP checksum disabled, the field is filled with 0xFFFF. > > > I think this is logically right!! If the checksum field to be all 1s, > > the sum of all field must be 0, which means, all fields must be 0. > > Impossible... > > > But!! > > > the rfc768.txt said > > ---> > > "If the computed checksum is zero, it is transmitted as all ones (the > > equivalent in one's complement arithmetic). An all zero transmitted > > checksum value means that the transmitter generated no checksum (for > > debugging or for higher level protocols that don't care). " > > > When UDP checksum disabled, the filed is filled with 0x0000 > > > Two documents say oppositely each other. > > > Which of them is right?? > > The RFC is correct. RFC 1122 restates it: > > IMPLEMENTATION: > There is a common implementation error in UDP > checksums. Unlike the TCP checksum, the UDP checksum > is optional; the value zero is transmitted in the > checksum field of a UDP header to indicate the absence > of a checksum. If the transmitter really calculates a > UDP checksum of zero, it must transmit the checksum as > all 1's (65535). No special action is required at the > receiver, since zero and 65535 are equivalent in 1's > complement arithmetic. > > > > > If as above, Normally computed checksum field value could be 0. but it > > would be considered as "disabled mode".... > > > I think the book DCN is right. because considering the way of checkum > > calculation, it is logically right. > > > but RFC!! > > > Maybe the checksum's meanning of the RFC sentences, the one before 1's > > complement computation??? > > When the RFC says "the computed checksum", it refers to the final value > AFTER performing the one's complement of the sum of all the bytes. So > if the ordinary sum is 0xffff, the computed checksum will be 0x0000. > The RFC then says that this should be transmitted as 0xffff. There's no > ambiguity because the ordinary sum can never be 0x0000. > > -- > Barry Margolin, bar...@alum.mit.edu > Arlington, MA > *** PLEASE post questions in newsgroups, not directly to me *** > *** PLEASE don't copy me on replies, I'll read them in the group ***- Hide quoted text - > > - Show quoted text - Let me check... case Sum Checksum the expression in the Checksum Field ================================================== =========== 1 0xff00 0x00ff 0x00ff 2 0x1111 0xeeee 0xeeee 3 0xffff 0x0000 0xffff 4 (in case of being disabled) 0x0000 5 0x0000 0xffff 0xffff Case 1, 2 are true, right? In case of sum 0xff like case 3 above, (it is the possible case), being handled specially and differently? In case 1 and 2, Checksum and the expression in the checksum field are equal, but in case 3 differnt? And, if case 4 right? I have thought case 5 is the case of UDP being disabled, because it can never happen, as the author Forouzan said. |
|
|
|
#5 |
|
Messages: n/a
Hébergeur: |
In article <1178156308.448602.33330@e65g2000hsc.googlegroups. com>,
khsharpy@gmail.com wrote: > Let me check... > > case Sum Checksum the > expression in the Checksum Field > ================================================== =========== > 1 0xff00 > 0x00ff 0x00ff > 2 0x1111 0xeeee > 0xeeee > 3 0xffff > 0x0000 0xffff > 4 (in case of being disabled) 0x0000 > > 5 0x0000 > 0xffff 0xffff > > > Case 1, 2 are true, right? Yes. > In case of sum 0xff like case 3 above, (it is the possible case), > being handled specially and differently? Yes. > In case 1 and 2, Checksum and the expression in the checksum field are > equal, but in case 3 differnt? Yes. > > And, if case 4 right? Yes. > > I have thought case 5 is the case of UDP being disabled, because it > can never happen, as the author Forouzan said. Right. One's complement sum includes an end-around carry. So if you add 0x0001 and 0xffff, you get 0x0001, not 0x0000. The only way to get 0x0000 as a one's complement sum is if all the bytes are zero. And as you noted earlier, no valid UDP packet can be all zero. -- Barry Margolin, barmar@alum.mit.edu Arlington, MA *** PLEASE post questions in newsgroups, not directly to me *** *** PLEASE don't copy me on replies, I'll read them in the group *** |
|
![]() |
| Outils de la discussion | |
|
|