Java Reference
In-Depth Information
In 21st-century TCP stacks, the high-order six bits of this byte contain a Differentiated
Services Code Point (DSCP) value and the low-order two bits contain an Explicit Con‐
gestion Notification (ECN) value. The DSCP thus has room for up to 2 6 different traffic
classes. However, it's up to individual networks and routers to specify exactly what the
64 different possible DSCP values mean. The four values shown in Table 8-1 are fairly
common.
Table 8-1. Common DSCP values and interpretations
PHB (Per Hop Behavior) Binary value Purpose
Default 00000 Best-effort traffic.
Expedited Forwarding (EF) 101110 Low-loss, low-delay, low-jitter traffic. Often limited to 30% or less of network
capacity.
Assured Forwarding (AF) multiple Assured delivery up to a specified rate.
Class Selector
xxx000
Backward compatibility with the IPv4 TOS header, as stored in the first three bits.
For example, the Expedited Forwarding PHB is a good choice for for VOIP. EF traffic
is often given strict priority queuing above all other traffic classes. This code fragment
sets a socket to use Expedited Forwarding by setting the traffic class to 10111000:
Socket s = new Socket ( "www.yahoo.com" , 80 );
s . setTrafficClass ( 0xB8 ); // 10111000 in binary
Remember the low-order two bits of this number are Explicit Congestion Notification,
and should be set to zero.
Assured Forwarding is actually 12 different DSCP values divided into four classes as
shown in Table 8-2 . The purpose here is to allow a sender to express relative preferences
for which packets to drop when the network is congested. Within a class, packets with
lower priority are dropped before packets with a higher priority. Between classes, pack‐
est from a higher-priority class are given preference, though lower-priority classes are
not starved completely.
Table 8-2. Assured forwarding priority classes
Class 1 (lowest priority)
Class 2
Class 3
Class 4 (highest priority)
Low Drop Rate
AF11 (001010)
AF21 (010010)
AF31 (011010)
AF41 (100010)
Medium Drop Rate
AF12 (001100)
AF22 (010100)
AF32 (011100)
AF42 (100100)
High Drop Rate
AF13 (001110)
AF23 (010110)
AF33 (011110)
AF43 (100110)
For example, the following code fragment sets up three sockets with different forward‐
ing characteristics. If the network gets congested enough, socket 3, in class 4 with a high
drop rate, will send most of its data. Socket 1, in class 1 with a low drop rate, will also
get to send data, though not as quickly as socket 1; and socket 3, with a high drop rate
also in class 1 will be blocked completely until the congestion eases up enough that
socket 2 is no longer dropping packets:
 
Search WWH ::




Custom Search