This is the Video 8 of the third course. This video is about network address validation. In many situation, a server code know that the connection have to come from a range of address. Example, if we do the code for some connected computer that manage hardware, we know that the command will come from the local network and not from the outside of the local network. We know the range address to accept connection from. In some other case, we don't know, the software is more open to connection from all the network address. But we know some exception where we don't want the connection come from. In both cases, we can add code to the server in order to validate the network address and restrict the connection to the computer we want to connect. We will wall the UDP_Server_0_b example together. I put a break point at the beginning of each function, so this way we will not miss any line. I just started a program. First line of domain. The example is very similar to the example UDP_Server_0_b. This is one of the difference at the start of the server, a unit, a whitelist. I use a whitelist for this example. The address need to be in the list in order to accept the connection. Here is the code that initialize the list. For sure in a real application, the list will most probably come from a configuration file. But in this to make it think he's you're, I just put some hard-coded value here. I will accept the connection from the local address. I will also accept the connection on the local sub network. Receive and process request. Here we wait for a request. I have the port number. I will send a valid request. The server received a request. We also get the address where the request came from, so we would be able to call the validate address function. The validate address with search in the list to check if the address is in the list. The address is in the list, yes, the address will be valid. A simple loop using STL iterator and yes, the address is in the list. The function validate address will return true and the request will be accepted and processed. This is the TCP_Server_0_c example. I put some break-point in the function that are not exactly the same than in the previous version, the TCP servers example. I'm ready to start the program. First function that is not exactly the same, it's a new function, and we initialize this time a blacklist. If the address is in the blacklist, that connection will not be accepted by the server, that is a TCP server. Connection have to be made before sending a request. If the address is in the blacklist, we will just fail the connection. The second function that is not assigned is the function that receive and process the request. We do and accept, wait for it to come in. Send invalid request. We received the connection and we have the address and the valid address. We will validate the address and it will function again. This function will do exactly the same as in the previous example, but we have a small negation operator here. If we find address in the list, we will not validate the address. Yes, we find address in the list. Here we have the small negation. The address is not valid, so will not process the request and would simply close the socket, so refuse the connection. In the last example, we used a blacklist, but a static blacklist. A server could also use a dynamic blacklist and add an address in the blacklist when it receive a very invalid request. So a request that could not come from a valid client software. This way it make harder for hacker to guess protocol. Some hacker could, oh, we got to an open port there. We don't know what is the service on this point, but we'll try a lot of thing. Whenever we blacklist this address, it will not be able to guess protocol this way. It will also make order to do with denial of service attack. Because the server will drop the connection as soon as the connection is established and will not lose request to try to validate header or request or even try to process their request. If a server do that, it must clear that dynamic part of the blacklist after some time or even maybe when the server is restart at the minimum, or odd or even. We need to do that because the IP address can use this time will maybe be used by a valid user in sometime because the address is given to another computer. This is the end of this video. The next video is about loading shared object and launching executable.