PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Noms de domaine > comp.protocols.tcp-ip > Q: UDP checksum
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.protocols.tcp-ip TCP and IP network protocols.

Q: UDP checksum

Réponse
 
LinkBack Outils de la discussion
Vieux 02/05/2007, 09h16   #1
khsharpy@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Q: UDP checksum

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~

  Réponse avec citation
Vieux 02/05/2007, 15h50   #2
Albert Manfredi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: UDP checksum

<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

  Réponse avec citation
Vieux 03/05/2007, 01h06   #3
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Q: UDP checksum

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 ***
  Réponse avec citation
Vieux 03/05/2007, 02h38   #4
khsharpy@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Q: UDP checksum

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.


  Réponse avec citation
Vieux 04/05/2007, 01h16   #5
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Q: UDP checksum

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 ***
  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h02.


Édité par : vBulletin® version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,17992 seconds with 13 queries