- Home Page of ProjectGuideline.com ›
- Forums ›
- Help for Ns2 Projects, Ns2 Code, Matlab Projects, Matlab Code, etc., ›
- Whitelist implementation in ns2
Hi Everyone,
I need some help in ns2. i am new to this tool and have little knowledge about it.
this is a small part of what i want to do.
If there are two content servers say server A and server B .
I connect to a request router R from my client which is a web browser H.
This is how it works.
Steps:
1. I connect from my client H to the request router R.
2. The request router R will do two things
(a) It will send me back the IP address of closest server (geographically located) to which i need to connect , say server A.
(b) It will send my IP address to the server A and let it know that i will connect, which will be stored in some white list there.
3. When i connect to the server A , the server A will check if my IP address is there in the white list , i.e. if the request router has sent this IP address to it, then only it will allow me to connect to it and access the content.
Else it will drop my connection request.
Can someone please help me with this.
If someone has used something like this in some project of theirs and would like to share their code it would be nice.
Else please guide me with what all i will need to know about in order to implement this.
Thanks in advance,
Hope i get some quick responses.
Michael.
Probably, no one will provide you any ready-made answer/code to this question.
According to my understanding, this can be implemented at tcl level ns2 simulation itself. For that, you can extend the class Agent/Messagepassing to behave as your protocol. (you have to extend the send and recv functions in your tcl code and write the protocol).
If you want to do it in a hard way, then you can do the same thing in c++ level code (you can extend the fuctionalities of messagepassing.cc and messagepassing.h)
Or you can write a new application level Agent or routing agent to handle this kind of communication scenario – but it will be more complex than the above two.
Thanks for the reply …
i thought of a better method of doing it .
This is how it will work and reduce the complexities
Steps:
1. User connects from client H to the request router R.
2. The request router R will have a hash function that will take User ip address and website address user wants to connect to as input and generate a server id.
H( U ip , W add ) -> Sid
then it looks up the S ip that maps to the Server id. say its server A’s IP address which is returned to the user.
3. When user connects to the server A , the server A will have same hash function which will get the user ip address and website which he wants to connect to and get the server id and check if its the same as its, then only it will allow user to connect to it and access the content.
Else it will drop the connection request.
So no need of the complexities as before.
Any suggestions on this method ..