Sie sind auf Seite 1von 2

[ Team LiB ]

2.8 SCTP Association Establishment and Termination


SCTP is connection-oriented like TCP, so it also has association establishment and termination
handshakes. However, SCTP's handshakes are different than TCP's, so we describe them here.

Four-Way Handshake
The following scenario, similar to TCP, occurs when an SCTP association is established:

• Table of Contents
1. The
UNIX® server
Network must be prepared
Programming Volume 1,to accept
Third an incoming
Edition: association.
The Sockets This preparation is
Networking
API normally done by calling socket,bind, and listen and is called a passive open.
ByW. Richard Stevens, Bill Fenner, Andrew M. Rudoff
2. The client issues an active open by calling connect or by sending a message, which
implicitly opens the association. This causes the client SCTP to send an INIT message
(which stands for "initialization") to tell the server the client's list of IP addresses, initial
Publisher: Addison Wesley
sequence number, initiation tag to identify all packets in this association, number of
Pub Date: November 21, 2003
outbound streams the client is requesting, and number of inbound streams the client can
ISBN: 0-13-141155-1
support.
Pages: 1024
3. The server acknowledges the client's INIT message with an INIT-ACK message, which
contains the server's list of IP addresses, initial sequence number, initiation tag, number
of outbound streams the server is requesting, number of inbound streams the server can
support,
"Everyone will and
wanta this
state cookie.
book The state
because cookieacontains
it provides great mix allofofpractical
the stateexperience,
that the server
historical
needs to
perspective, andensure thatofthe
a depth association isthat
understanding valid, and
only is digitally
comes signedintimately
from being to ensureinvolved
its validity.
in
the field. I've already enjoyed and learned from reading this book, and surely you will too."
4. The
-Sam client echos the server's state cookie with a COOKIE-ECHO message. This message
Leffler
may also contain user data bundled within the same packet.
The classic guide to UNIX networking APIs... now completely updated!
5. The server acknowledges that the cookie was correct and that the association was
established
To build with adistributed,
today's highly COOKIE-ACK message.
networked This message
applications andmay also contain
services, you needuser
deepdata
bundled
mastery withinand
of sockets the other
samekeypacket.
networking APIs. One book delivers comprehensive, start-to-
finish guidance for building robust, high-performance networked systems in any environment:
The
UNIXminimum
Network number of packets
Programming, required
Volume for this
1, Third exchange
Edition . is four; hence, this process is
called SCTP's four-way handshake. We show a picture of the four segments in Figure 2.6.
Building on the legendary work of W. Richard Stevens, this edition has been fully updated by
two leading network programming
Figure 2.6.expertsSCTPtofour-way
address today's most crucial standards,
handshake.
implementations, and techniques. New topics include:

POSIX Single UNIX Specification Version 3

IPv6 APIs (including updated guidance on IPv6/IPv4 interoperability)

The new SCTP transport protocol

IPsec-based Key Management Sockets

FreeBSD 4.8/5.1, Red Hat Linux 9.x, Solaris 9, AIX 5.x, HP-UX, and Mac OS X
implementations

New network program debugging techniques

Source Specific Multicast API, the key enabler for widespread IP multicast deployment
The SCTP four-way handshake is similar in many ways to TCP's three-way handshake, except
[ Team LiB ]

2.9 Port Numbers


At any given time, multiple processes can be using any given transport: UDP, SCTP, or TCP. All
three transport layers use 16-bit integer port numbers to differentiate between these
processes.

When a client wants to contact a server, the client must identify the server with which it wants
to communicate. TCP, UDP, and SCTP define a group of well-known ports to identify well-
known services. For example, every TCP/IP implementation that supports FTP assigns the well-
known port of 21 (decimal) to the FTP server. Trivial File Transfer Protocol (TFTP) servers are
assigned the UDP port of 69.

Clients, Table
on the of Contents
other hand, normally use ephemeral ports, that is, short-lived ports. These port
UNIX® Network
numbers Programming
are normally Volume
assigned 1, Third Edition:
automatically byThe
theSockets Networking
transport protocol to the client. Clients
API
normally do not care about the value of the ephemeral port; the client just needs to be certain
ByW. the
that Richard Stevens,Bill
ephemeral Fenner
port , Andrew
is unique onM.the
Rudoff
client host. The transport protocol code guarantees
this uniqueness.

ThePublisher:
Internet Addison
Assigned Numbers Authority (IANA) maintains a list of port number assignments.
Wesley
Assignments were once
Pub Date: November published as RFCs; RFC 1700 [Reynolds and Postel 1994] is the last in
21, 2003
this series. RFC 3232 [Reynolds
ISBN: 0-13-141155-1 2002] gives the location of the online database that replaced
RFC 1700: http://www.iana.org/.
Pages: 1024 The port numbers are divided into three ranges:

1. Thewell-known ports: 0 through 1023. These port numbers are controlled and assigned
by the IANA. When possible, the same port is assigned to a given service for TCP, UDP,
"Everyone will want
and SCTP. For this book because
example, port 80 isit assigned
provides for
a great mix
a Web of practical
server, experience,
for both historical
TCP and UDP, even
perspective, and a depth of understanding that only
though all implementations currently use only TCP. comes from being intimately involved in
the field. I've already enjoyed and learned from reading this book, and surely you will too."
-Sam Leffler At the time that port 80 was assigned, SCTP did not yet exist. New port assignments
are made for all three protocols, and RFC 2960 states that all existing TCP port
The classicnumbers
guide to UNIX
shouldnetworking
be valid forAPIs... nowservice
the same completely
usingupdated!
SCTP.
To2.build
Thetoday's highly
registered distributed,
ports: networked
1024 through 49151.applications
These are notandcontrolled
services, you need
by the deep
IANA, but the
mastery of sockets and other key networking APIs. One book delivers comprehensive,
IANA registers and lists the uses of these ports as a convenience to the community. start-to-
When
finish possible,
guidancethe
for same
building robust,
port high-performance
is assigned networked
to a given service systems
for both in any
TCP and UDP.environment:
For example,
UNIX ports
Network Programming,
6000 through 6063Volume 1, ThirdforEdition
are assigned .
an X Window server for both protocols, even
though all implementations currently use only TCP. The upper limit of 49151 for these
Building on was
ports the legendary
introducedwork of W.
to allow Richard
a range forStevens, thisports;
ephemeral editionRFC
has1700
been[Reynolds
fully updated
and by
two leading network programming experts to
Postel 1994] lists the upper range as 65535. address today's most crucial standards,
implementations, and techniques. New topics include:
3. Thedynamic orprivateports, 49152 through 65535. The IANA says nothing about these
ports. These are what we call ephemeral ports. (The magic number 49152 is three-
POSIX Single UNIX Specification Version 3
fourths of 65536.)
IPv6 APIs (including updated guidance on IPv6/IPv4 interoperability)
Figure 2.10 shows this division, along with the common allocation of the port numbers.
The new SCTP transport protocol
Figure 2.10. Allocation of port numbers.
IPsec-based Key Management Sockets

FreeBSD 4.8/5.1, Red Hat Linux 9.x, Solaris 9, AIX 5.x, HP-UX, and Mac OS X
implementations

New network program debugging techniques

Source Specific Multicast API, the key enabler for widespread IP multicast deployment

Das könnte Ihnen auch gefallen