ally obtaining from the network. Packets are policed by being appropriately marked. Policing can occur at the domain level (as with protocols such as DiffServ) or they can be policed at the line-card level, usually at the ingress port. This operation can be done by using several marking algorithms. The most common of these algo- rithms is the three-color algorithm. For example, in the implementation of such an algorithm, a packet that is within its flow's SLA can be marked green and the traffic manager will forward it if and when it is feasible. If the packet is out of the contract boundaries but it is still stipulated that the packet should be forwarded if at all possible, then the traffic manager will mark it yellow. Unless traffic con- gestion occurs, it will be forwarded when possible. Finally, a packet is marked red when it does not conform to the contract that manages that specific flow and it will be discarded (dropped). As an exam- ple, in the DiffServ AF PHB, a marking algorithm, such as the three-color approaches described by either the two-rate three-color marker (trTCM) or single-rate three-color marker (srTCM), estab- lishes the packet-discarding precedence. Downloaded from Digital Engineering Library @ McGraw-Hill (www.digitalengineeringlibrary.com) Copyright © 2004 The McGraw-Hill Companies. All rights reserved. Any use is subject to the Terms of Use as given at the website. TRAFFIC MANAGERS 322 NETWORK PROCESSORS If policing is an ingress port task, then traffic shaping should be organized at the egress port. It is capable of handling the potentially bursty nature of some traffic by ensuring that it is released into the network in transmission rates that are commensurate with what is stipulated in the corresponding SLA. Several algorithms are used in this realm based on whether the underlying network is packet based and therefore connectionless (such as IP-based networks) or connection oriented (such as ATM). The token bucket approach is usually taken on packet-based networks, whereas the leaky bu