e security for voice and data traffic. Algo- rithm 5 (A5) is used with K and current Time Division Multiple Access (TDMA) frame number as inputs to generate a ciphering code. The mobile station calculates K from the RAND and Ki and stores it on the SIM. The BSS is given K by the Visitor Location Register (VLR) or SGSN. In the uplink direction, the mobile ciphers the data and the BSS deciphers it. A similar process takes place on the downlink. The cipher key is different in the uplink and downlink direction. The TDMA frame number changes approximately every 4.6 ms (a TDMA frame period) and is not repeated for 3.5 hours, making it difficult for the cipher code to be cracked. Some countries allow ciphering as an option, others for- bid it. The network also has the option to start ciphering without authen- tication. Web Access To achieve a Web access, the mobile station first performs a GPRS attach procedure to become ready and then the PDP context activation to establish communications with an Internet host, as shown in Figure 5-19. The SGSN encapsulates the outgoing data and routes the packets to the appropriate GGSN, where they are sent to the Internet. Inside this net- work, PDN-specific routing procedures are applied to send the packets to the corresponding host. In the other direction, the incoming data are carried out to the Packet Control Unit Support Node (PCUSN), which first estab- lishes a downlink radio channel with the mobile station. Using the TTLI for the mobile station, the PCUSN notifies the mobile station of the channels (and the uplink state flags [USFs]) over which the data will be transferred using the Downlink Packet Resource Assignment message. The procedure continues with the data transfer to the mobile station. The main functions of the GPRS procedures create the means for the mobile station to attach or detach from the network. Many other procedures Downloaded from Digital Engineering Library @ McGraw-Hill (www.digitalengineeringlibrary.com) Copyright © 2004 The McGraw-Hill Companies. All ri