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 > TCP checksum
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
comp.protocols.tcp-ip TCP and IP network protocols.

TCP checksum

Réponse
 
LinkBack Outils de la discussion
Vieux 14/10/2007, 10h14   #1
autom4gician@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut TCP checksum

Hi,

I'm developing my own TCP stack and I'm having a problem with
calculating the TCP checksum. According to the information I gathered
from the internet, the TCP checksum is calculated based on the IP
pseudoheader (that is source IP, destination IP, protocol (0x06 for
TCP) and overall packet length) and complete TCP header together with
data to be sent. The checksum is one's complement of sum of all 16-bit
words. I'm almost sure it is calculated correctly as it works ok for
the IP header. Do you have any suggestions on what can I be doing
wrong? Do I have to convert all header data to network byte order
before calculating the checksum (I'm doing it this way now)?

Thanks in advance

Chris

  Réponse avec citation
Vieux 14/10/2007, 18h20   #2
Barry Margolin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: TCP checksum

In article <1192353288.702518.237280@q3g2000prf.googlegroups. com>,
autom4gician@gmail.com wrote:

> Hi,
>
> I'm developing my own TCP stack and I'm having a problem with
> calculating the TCP checksum. According to the information I gathered
> from the internet, the TCP checksum is calculated based on the IP
> pseudoheader (that is source IP, destination IP, protocol (0x06 for
> TCP) and overall packet length) and complete TCP header together with
> data to be sent. The checksum is one's complement of sum of all 16-bit
> words. I'm almost sure it is calculated correctly as it works ok for
> the IP header. Do you have any suggestions on what can I be doing
> wrong? Do I have to convert all header data to network byte order
> before calculating the checksum (I'm doing it this way now)?


Have you read RFC 1071, "Computing the Internet Checksum"?

--
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 15/10/2007, 17h56   #3
autom4gician@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: TCP checksum

On 14 Pa , 19:20, Barry Margolin <bar...@alum.mit.edu> wrote:
> In article <1192353288.702518.237...@q3g2000prf.googlegroups. com>,
>
> autom4gic...@gmail.com wrote:
> > Hi,

>
> > I'm developing my own TCP stack and I'm having a problem with
> > calculating the TCP checksum. According to the information I gathered
> > from the internet, the TCP checksum is calculated based on the IP
> > pseudoheader (that is source IP, destination IP, protocol (0x06 for
> > TCP) and overall packet length) and complete TCP header together with
> > data to be sent. The checksum is one's complement of sum of all 16-bit
> > words. I'm almost sure it is calculated correctly as it works ok for
> > the IP header. Do you have any suggestions on what can I be doing
> > wrong? Do I have to convert all header data to network byte order
> > before calculating the checksum (I'm doing it this way now)?

>
> Have you read RFC 1071, "Computing the Internet Checksum"?
>
> --
> 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 ***


I read that RFC, and my algorithm was correct. The problem was with
the data - I failed to convert one of the header fields to network
byte order. I managed to solve my problem, but thanks anyway for your
. A calculator seems the best tool in cases like this

Chris

  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 09h36.


Édité par : vBulletin® version 3.7.3
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 ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11960 seconds with 11 queries