Specifications
Networking protocols and the software that implements them are usually arranged as a stack of
layers. Each layer can pass data to the layer above or below, and request services of the layer
above or below. Figure 15.2 shows such a protocol stack.
Implementing Secure Transactions with PHP and MySQL
C
HAPTER 15
15
I
MPLEMENTING
S
ECURE
TRANSACTIONS
333
HTTP FTP SMTP …
TCP/UDP
IP
Various
Application Layer
Transport Layer
Network Layer
Host to Network Layer
FIGURE 15.2
The protocol stack used by an application layer protocol such as Hypertext Transfer Protocol.
When you use HTTP to transfer information, the HTTP protocol calls on the Transmission
Control Protocol (TCP), which in turn relies on the Internet Protocol (IP). This protocol in
turn needs an appropriate protocol for the network hardware being used to take packets of data
and send them as an electrical signal to our destination.
HTTP is called an application layer protocol. There are many other application layer protocols
such as FTP, SMTP and telnet (as shown in the figure), and others such as POP and IMAP.
TCP is one of two transport layer protocols used in TCP/IP networks. IP is the protocol at the
network layer. The host to network layer is responsible for connecting our host (computer) to a
network. The TCP/IP protocol stack does not specify the protocols used for this layer, as we
need different protocols for different types of networks.
When sending data, the data is sent down through the stack from an application to the physical
network media. When receiving data, data travels up from the physical network, through the
stack, to the application.
Using SSL adds an additional transparent layer to this model. The SSL layer exists between the
transport layer and the application layer. This is shown in Figure 15.3. The SSL layer modifies
the data from our HTTP application before giving it to the transport layer to send it to its desti-
nation.
SSL
Handshake
Protocol
SSL
Change
Cipher
HTTP
SSL
Alert
Protocol
…
SSL Record Protocol
TCP
IP
Application Layer
SSL Layer
Transport Layer
Network Layer
Host to Network Layer
Host to Network
FIGURE 15.3
SSL adds an additional layer to the protocol stack as well as application layer protocols for controlling its own
operation.
19 7842 CH15 3/6/01 3:40 PM Page 333










