fixing WEP by treating all messages as one long stream in the course of introduction to cryptography on coursera
professor suggested treating all messages as a long stream XORing them with the key
this way we will not need to change the key and will not have the IV problem
and the question is
if so how can we generate a key that will encrypt the whole traffic using just XOR
Well, WEP uses RC4 to encrypt, and RC4 can be used to generate a long keystream to encrypt multiple messages.  The key would be negotiated when the connection starts; both sides would hand over the negotiated session key to the RC4 algorithm, and RC4 then generates a long keystream that can be used to encryption.  In fact, when SSL uses RC4, it does exactly this.

However, when it comes to WEP, there is a significant practical problem that doesn't arise with SSL; message reliability.  With SSL, the protocol assumes that the protocol is run over a reliable transport (generally TCP); the transport protocol will ensure that the receiver will get every message the sender sends, and in the correct order (and if it can't ensure that, it raises an error condition that shuts down the connection.

This is important for RC4; it generates a separate part of the keystream for every message.  For, if we encrypt two 100 byte messages, bytes 0 through 99 of the keystream will be used to encrypt message 1, and bytes 100 through 199 of the keystream will be used to encrypt message 2.  When the receiver gets the encrypted message 1, he can use his copy of the RC4 keystream generator to create bytes 0 through 99 of the keystream, and decrypt message 1.

The problem comes in if the receiver never receives message 1, and instead receives message 2.  If he were to ask RC4 for the next 100 bytes of the keystream, he'd get bytes 0 through 99, which won't decrypt message 2 properly at all.

With SSL, this situation never comes up; the underlying TCP protocol will ensure that message 1 will always arrive first (unless there's some man-in-the-middle attacker; yes, he can cause the connection to shut down; there's other protections in place that ensure he can't do anything else).

However, WEP is designed to protect wireless connections; the messages that it protects are datagrams transmitted over the radio.  In practice, it is quite common for messages to not be received correctly (because of interference).  Because of this, WEP cannot assume that all transmitted messages will be received, and so WEP cannot use a long-standing RC4 key.

A cryptographic protocol needs to meet multiple goals; they ought to be secure; however, they also need to work well with the overall system design.  WEP, as designed, does the latter reasonably well; it's just the former they missed a bit.