otocol stack. In the OSI stack the presenta- tion layer transforms the message in a certain way (e.g., text compression) and then passes the new message to the session layer (5). The session layer, in this example, does not modify the message but regulates the data flow to pre- vent an incoming message from being handed over to the presentation layer while it is busy. Data units given to the lower layers are called protocol data units, for example, an application protocol data unit (APDU). In most networks a data packet has a certain maximum length, but usu- ally there is no limit to the size of messages accepted by the transport layer. If the message is very long, the transport layer must break it up into smaller units, adding a header to each unit. The header includes control information such as a sequence number. In many networks, such as the Internet, transmitted units may arrive in a different order than they were transmitted. With the sequence number the transport layer at the destination machine is able to build the original message by placing the transmitted pieces into the correct order. Data Communications Protocol Data Units (PDUs) (exchanged information Source between peer layers) Destination Application Layer 7 protocol, APDU (+ presentation and session) Split up by layer 4 L 4, TPDU Transport L 3, packet Network Data link L 2, frame Physical layer L1, bits and channel 01101 Figure 6.12 Data flow through a protocol stack. The network layer (3) looks up the routing table and decides which of the outgoing lines to use. It attaches its own headers such as the address of the destination network layer and passes the data to data link layer (2). The network layer message is often called a packet. The data link layer adds a header and also a trailer and gives the result- ing unit to the physical layer for transmission. The header may include start-of-frame flag and physical addresses in an LAN. The trailer is needed for end-of-frame flag and error detection. The message of the data link layer is often calle