CW is the Collision Window, which grows multiplicatively each time a frame is transmitted but not acknowledged, up to a maximum collision window size CWmax. Once the frame has been transmitted successfully, the collision window shrinks to a small value (CWmin) again.
+---------------+----------+--------+--------+--------+-------------+--------+---------+-----+ | frame control | duration | addr 1 | addr 2 | addr 3 | seq control | addr 4 | payload | CRC | +---------------+----------+--------+--------+--------+-------------+--------+---------+-----+
Important note: 802.11 addresses are the same length (6 bytes) as ethernet addresses, and are allocated from the same address space. This allows 802.11 networks to be directly connected to an ethernet network: the hosts (both 802.11 and ethernet) can communicate with each other transparently.
Why four address fields in an 802.11 frame? Addresses 1 and 2 specify the recipient and sender wireless hosts, while address 3 specifies (optionally) the address of a wired network interface inside the wired the network to which the access point is connected.
Scenarios: wireless host A sends an IP datagram to host B
In the third case, the router decides how to forward the datagram by looking at the destination IP address.
Wireless hosts periodically poll for the signal strength of access points in the area. If a stronger signal is detected, the host can disassociated from the current access point and associate with a new access point.
If two access points both belong to the same IP subnet, then wireless hosts can move from one to the other while retaining their IP address, open TCP connections, etc. This is because changing association from one access point to another is purely a link-layer function, and thus is transparent to the network layer above.
Want to allow a host to move to a different network while retaining its original (permanent) IP address. This is the problem of IP mobility.
A mobile host A is visiting a foriegn network F. In the foreign network, it registers itself with the foreign agent, which is a host in the foreign network that handles traffic bound for visiting mobile hosts. (It is most efficient for the foreign agent to be an edge router, which is how it is shown in the example.) The foreign agent establishes a care-of-address (COA) for the mobile host, and then contacts the mobile host's home agent to inform it of the mobile host's COA. The home agent is host in the mobile host's home network that handles traffic sent to the mobile host while it is away.
A datagram sent by correspondent C to A will be delivered to the home agent (step 1). The home agent will then encapsulate the datagram in another datagram addressed to the foreign agent via the COA established by the foreign agent: when the foreign agent receives this datagram it will decapsulate the original datagram and forward it to the mobile host A (step 2). A can then send a reply datagram to C using normal unicast routing (step 3).
A home agent must obviously take care to authenticate requests from a foreign agent, in order to ensure that they truly originate from the mobile host. Otherwise, an attacker could divert all traffic bound for A to his own machine.
In direct routing, the correspondent uses a correspondent agent to communicate with the mobile host. On the initial attempt to contact the mobile host in its home network, the home agent informs the correspondent agent of the mobile host's COA in the foreign network. Subsequent communication is sent directly to the COA, and the foreign agent then relays the datagrams to the mobile host.