`{Itust A
`\olupe
`
`ea)
`The B pe
`
`Loole
`
`Oat
`
`e
`ea
`Le)
`
`2o
`
`e
`eS
`
`a a (
`
`Ss
`
`< a
`
`z,
`
`a= F
`
`a)
`a)
`Sp
`aa
`
`aT
`
`ar
`
`4>
`
`)
`oe
`<i
`
`=N
`
`nai
`
`me
`aa
`
`5]
`ZO
`
`OU12
`
`
`
`UNIX is a technology trademark of X/Open Company,Ltd.
`
`The publisher offers discounts on this book when ordered in quantity for specialsales.
`For more information please contact:
`Corporate & Professional Publishing Group
`Addison-Wesley Publishing Company
`One Jacob Way
`Reading, Massachusetts 01867
`
`Library of Congress Cataloging-in-Publication Data
`Stevens, W. Richard
`TCP/IP Illustrated: the protocols/W. Richard Stevens.
`p. cm. — (Addison-Wesley professional computingseries)
`Includes bibliographical references andindex.
`ISBN 0-201-63346-9 (v. 1)
`1,TCP/IP (Computer networkprotocol)I. Title. II. Series.
`TK5105.55574 1994
`004.6°2—de20
`
`Copyright © 1994 Addison Wesley Longman,Inc.
`
`All rights reserved. No part of this publication may be reproduced,stored in a retrieval system,
`or transmitted in any form or by any means, electronic, mechanical, photocopying, recording,or
`otherwise, without prior written permission of the publisher. Printed in the United States of
`America. Published simultaneously in Canada.
`
`Text printed on recycled and acid-free paper
`ISBN 0-201-63346-9
`
`10111213141516 MA 00 99 98 97
`
`10th Printing July, 1997
`
`
`
`
`TCP: Transmission Control Protocol
`Chapter17
`
`Each TCP segmentcontains the source and destination port number to identify the
`sending and receiving application. These two values, along with the source and desti-
`
`fies each TCP connection in an internet.
`The sequence numberidenti
`
`chapter where we'll see that the FIN flag consumes a sequence numberalso.)
`Since every byte thatis exchanged is numbered, the acknowledgment number contains
`This is therefore the Sequence number plus 1 of the last successfully received byte af
`data. This field is valid only if the ACK flag (described below)is on.
`Sending an ACK costs nothing because the 32-bit acknowledgment numberfield Ss
`always part of the header, as is the ACK flag. Therefore we'll see that once a connection
`is established,this field is alwaysset and the ACK flag is alwayson.
`be flowing in each direction, independentof the other direction. Therefore, each end =
`a connection must maintain a sequence numberof the data flowing in each direction.
`TCP can be described as a sliding-window protocol withoutselective or negative
`acknowledgments.
`(The sliding window protocol used for data transmission =
`described in Section 20.3.) We say that TCP lacks selective acknowledgments because
`the acknowledgment numberin the TCP headermeansthat the senderhas successfull
`received up through but not including that byte. There is currently no way to acknowl
`edge selected pieces of the data stream. For example,if bytes 1-1024 are received OK,
`and the next segment contains bytes 2049-3072, the receiver cannot acknowledge this
`
`The header length gives the length of the headerin 32-bit words. This is requissdl
`because the length of the optionsfield is variable. With a 4-bit field, TCPis limited wa
`60-byte header. Without options, however, the normalsize is 20 bytes.
`
`=
`
`