* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Download Bilkent University - Networking and Systems Research Group
Survey
Document related concepts
Wake-on-LAN wikipedia , lookup
Distributed firewall wikipedia , lookup
Recursive InterNetwork Architecture (RINA) wikipedia , lookup
Computer network wikipedia , lookup
Network tap wikipedia , lookup
Dynamic Host Configuration Protocol wikipedia , lookup
Wireless security wikipedia , lookup
Piggybacking (Internet access) wikipedia , lookup
Airborne Networking wikipedia , lookup
Remote Desktop Services wikipedia , lookup
Zero-configuration networking wikipedia , lookup
Cracking of wireless networks wikipedia , lookup
Transcript
Bilkent University Faculty of Engineering EEE436 / CS422 Wireless Networking Technologies and Applications Progress Report 1 Group 2: Cemil Can Coşkun – 20503117 Selin Dağ – 20602232 İbrahim Gürses – 20402327 Çise Mıdoğlu – 20602390 Topic: Pictionary game application for wireless ad-hoc networks. 19.03.2010 Ankara EEE436 / CS422: Group 2 Progress Report 1 INDEX 1. Introduction.........................................................................................................................................2 2. Research Conducted……………………………………………………………………………………………………………………….2 2.1. Setting Up an Ad-Hoc Network............................................................................................2 2.1.1 What Is an Ad-Hoc Network?.............................................................................................2 2.1.1.1. Server-Client Type Ad-Hoc Network…………………………………………………………………………..3 2.1.1.2 Peer to Peer Type Ad-Hoc Network…………………………………………………………………………….4 3. Project Updates...................................................................................................................................5 3.1. Network Type Selection…………………………………………………………………………………………………..5 3.2. Programming Language Selection …………………………………………………………………………………..5 4. Prototype.............................................................................................................................................6 5. References.........................................................................................................................................10 1 EEE436 / CS422: Group 2 Progress Report 1 1. Introduction This document briefly specifies the achievements that have been accomplished by Group 2 during the period: 05.03.2010 – 18.03.2010. The accomplishments can be categorized as: conducting research on setting up a network among mobile laptop users, types of ad-hoc networks choosing the most appropriate programming language to begin coding the user interface preparing a basic prototype that tests the simultaneous image broadcasting feature 2. Research Conducted 2.1 Setting Up an Ad-Hoc Network There are two type of wireless system which we can use for this project. One of them is using routers to orient files. Second one is create ad-hoc network between the computers. We prefer ad-hoc network because using router to orient files is not suitable for our project. Our plan is that user can play game only when they have computer nothing more. There are two types of ad-hoc network which is suitable for our project. First one is server-client type ad-hoc network. Second one is peer to peer type ad hoc network. 2.1.1 What Is an Ad-Hoc Network? After the growth of Internet, portable devices such as laptops have led to an increasing interest in mobile computing and networking. Laptop users always prefer to use internet when they are mobile. Most of the research in mobile networking has focused on the case where the mobile user has a “home” network that the user usually uses and tries to solve the problem keep user connected to network when we visit foreign network. There are lots of protocol and solution to solve this problem. However, all these protocols and solutions assume that there is an established infrastructure which is consisting of routers. A different situation arises when there is no such established infrastructure on which depend; such a network is called an ad hoc network. An ad hoc network is a temporary network which has following characteristics: No infrastructure: No established or well known servers and no internet connection. A network spanning multiple hops: one node may not be able to get data directly. Instead the data can travel over several intermediate nodes to reach the destination. The nodes in the network can be mobile. A dynamic structure: the topology of the network cannot be static because some nodes are mobile. So the topology must be change rapidly. 2 EEE436 / CS422: Group 2 Progress Report 1 2.1.1.1. Server-Client Type Ad-Hoc Network Client-server computing or networking is a distributed application architecture that partitions tasks or workloads between server and clients. A server machine is a high-performance host that is running one or more server programs which share its resources with client. Client does not share any of its resources. So client must initiate communication sessions with servers. The client communicates with other clients through the server according to a protocol that standardizes a dialogue channel between the clients and server. The client server communication protocol must follow following steps: 1. The client starts its communication through sending the initialization request to the server. 2. The server checks the authorization; if it is, then it passes its request to the DHCP to assign it IP address. Otherwise, it rejects the request. 3. If the client successfully passed the step 2, then it sends data to the server. 4. However, before the server registers data, it verifies the static properties of this client to see if it has already been registered or not; if it hasn’t been registered, then it terminates the communication with it. 5. If the client successfully passed the step 4, then the server verifies to see whether this client contacted it before or not. 6. If the client contacted it before, then the server updates the client’s data by the newest one. Otherwise, it initializes an entry with the client’s dynamic data in the dynamic database. 7. The server starts to check the validity of the client’s data in the dynamic database. If the server detected that the client’s data hasn’t been updated for certain time then it deletes its data. 8. If the server still detects the client, so it sends it all other clients’ modem numbers, equipments, directions, speeds, positions, and zones. 9. The client analyzes this data and establishes communication with the most convenient client to it. 10. The client continues exchanging its data analysis with which it succeeded to open communication channel in the step 9. The Ad-hoc protocol manages the communication channels between the clients according to the routing algorithm in the same zone. The protocol procedure is organized in the following functions: scanning and detection the vehicles, connections establishment, collaborations and communications, verification the connections reliability, and finally sending the conclusions to the server through the GSM Modem. 1. First, Client-Server starts to run, so it does step 1 and 2. 2. If the client successfully passed the step 2 in Client-Server, then Ad-hoc communication starts to run. 3. The Ad-hoc client initializes the different lists parameters. 4. Then it scans its zone looking for new clients. 5. The Ad-hoc client forwards other clients requests to the Ad-hoc server part to treat them. 6. The Ad-hoc client compares its list of detected clients in its zone with the one that it gets through the Client-Server. 3 EEE436 / CS422: Group 2 Progress Report 1 7. The Ad-hoc client verifies the current connections with the Ad-hoc server part, then it creates connections with the most close for it in its zone, and breaks all the non reliable connections. 8. If the connections are impossible, then it communicates with others through the ClientServer. 2.1.1.2 Peer to Peer Type Ad-Hoc Network A mobile ad hoc network (MANET) is a collection of mobile nodes that dynamically self organize in a wireless network without using any pre-existing infrastructure. In a MANET, the applications prefer “peer to peer” rather than “client-server”. In the Internet, a P2P network is basically an overlay network justified by the need of specialized functions. Classical examples of Internet overlay networks are: Gnutella, BitTorrent, KaZaA etc. MANETs are based on a network architecture that is quite different from the wired Internet architecture. The MANET routing functionality is offered by P2P network. There is a definite need for P2P networking in MANET because the MANET routing layer is often inadequate to provide the services needed by sophisticated mobile application and the unpredictability of the radio channel combined with mobility of the users can pose major challenges to routing and upper layer intervention. One of the main advantages of P2P over ad-hoc network would be easiness of forming network, since not necessary to have infrastructure nor it depends on a central server. Example of possible uses of P2P over ad-hoc networks include application that alert us to the presence of friends at a crowded public space or identify people we want to meet taking into account our preferences and interests systems that spread rumors, facilitate the exchange of personal information or support us in more complex taxes. On the other hand P2P over ad-hoc networks is a very dynamic combination that demands, among other things, special attention regarding configuration issues. 4 EEE436 / CS422: Group 2 Progress Report 1 3. Project Updates 3.1. Network Type Selection We determine to use a mobile ad hoc peer to peer (MAP) file sharing system to communication of each player. We prefer P2P instead of Server-Client type because timing is very important for our system if we use Server-Client TCP connection, each user has to send “the picture” firstly to server, after that server will send “the picture” to each client. It will cause duplicate transmission. So it can cause timing problem. 3.2. Programming Language Selection In the proposal, we proposed Java as the implementation language, but we have seen that Java can have some problems with wireless programming on window applications. Java does not have a good IDE for developing UI. Although NetBeans provides such a feature, the code it produces is too complex to understand and modify. .NET window form designer producer simpler code and it is easy to modify. Also there are other reasons for schinging the implementation language which is discussed in the next section. 5 EEE436 / CS422: Group 2 Progress Report 1 4. The Development of the First Prototype for Pictionary Application We have developed a prototype application in order to understand socket programming and concurrent programming in C#. C# is an interpreted language which uses .NET framework for windows form applications. It is a hybrid language which supports object oriented programming. The design principles for the language libraries are the same as Java. In Java there is Swing library for creating user interfaces and in C# there is GDI (Graphics Device Interface) library, which have the same classes, which corresponds to the Swing library function. The design of an interface with .NET and GDI is so easy with Visual Studio 2008 with the help of built in UI designer. However, GDI has limited number of functionalities as Swing library. . NET framework provides another tool to overcome this lack of complexity. It is called Windows Presentation Foundation (WPF) which provides a unified framework for building applications and high-fidelity experiences in Windows that blend together application UI, documents, and media content, while exploiting the full power of the computer. WPF offers developers support for 2D and 3D graphics, hardware-accelerated effects, scalability to different form factors, interactive data visualization, and superior content readability. Further, with a common file format (XAML), designers can become an integral part of the development process by working alongside developers in a workflow that promotes creativity while maintaining full fidelity.[1]. WPF uses Direct X for graphics rendering and programmer can create really innovative user interface designs with it. Also since DirextX uses GPU, the load is taken from CPU and CPU can be used for other things. For now, we developed our prototype with GDI which is sufficient for 2D drawing, but we are researching WPF for developing a new innovative user interface for the painting component of our program which will make 3D drawing possible. . NET also gives application programmer a nice library for Socket programming. The syntax and the class names almost identical to the Java socket library. Since all of our group members took the CS 421 course, all the group members can easily create programs by using socket. Also C# provides good tools for concurrent programming such as threads, locks and monitors. In the implementation of prototype we have used these classes. In this prototype, our aim was broadcasting what is drawn on the screen to the other programs in the underlying network. We have developed two applications, first one is the server program which the player draws on a panel by the help of mouse, the second one is the client program which listens to a socket for an image and updates the screen after getting the screen. The client also tries to guess what is being drawn on the screen. However, we could not add the sending the guess back to the server functionality due to time constraints. We have tested our program under a wireless ad-hoc network. Once the OS establishes a wireless ad hoc network, we get the IP address of each computer and modify our programs and re-compile them and run the application. The programs run well in ad-hoc 6 EEE436 / CS422: Group 2 Progress Report 1 mode well unless none of the computers leave the range radius of each other. Because Windows does not have any routing algorithm for multihop ad-hoc networks our programs did not run correctly when one of them gets out of the range of the server. We have also set up an infrastructure wireless network by the help of an ADSL modem. The ADSL modem uses DHCP and assigns a unique IP address to each of the connected computers. Then we get the IP address of each computer and run our programs, we did not come up any problems. In this mode our server program could send the images to 5 different computers without any problem. We have decided to use an architecture, which is used in many computer games for our program. In this architecture one player creates a game as a host so that other player can join this game. When the host creates the game, the client programs search the underlying network for a game to join. Once they found the host they connect to the host and all the users are welcomed with a lobby screen. In this lobby screen players can chat until the game starts. Once each player says they are ready the game starts. By using this approach our program can support both ad-hoc and infrastructure mode. And the players are not bothered with the technical details of the network such as entering IP addresses for each computer. For example, this approach will enable players to play the game while sitting in a café where public wireless internet is available, because each computer will connect the same access point and our game will use only DHCP IP addresses and the internet connection will use the IP address of the access point or router. Figure 1: The screen for the active drawing player 7 EEE436 / CS422: Group 2 Progress Report 1 In Figure 1, you can see the screen for the player who is drawing. The word which he tries to tell is “tree”. Every time this program is run a random word is chosen from our database which is only an array of strings for this prototype. The player selects the drawing tool pen by clicking the “Pen” button. In this prototype, we have only implemented pen tool. Then the player draws the word on the screen. Then, on a separate thread our program takes the image drawn in a Bitmap class object. In C#, a Bitmap object is serializable object which can be represented as streams of bits. The worker thread takes the Bitmap object and serializer it by using BinaryFormatter class. Once we serialize the Bitmap, we put it on a byte array. Then we broadcast this byte array to the client programs by writing it on the sockets stream. This process is repeated in one second interval. In each second interval, the server program broadcast what is drawn on its panel. Figure 2: The screen of Client 1 8 EEE436 / CS422: Group 2 Progress Report 1 Figure 3: The screen of Client 2 In Figure 2 and 3, you can see that once the server broadcasts the image drawn on its panel, the two client programs updates their panels after getting the image from the buffer of their own socket. Since the buffer has only a stream of bits, we need to deserialize the buffer and get the Bitmap object and draw it on the screen. The client programs have a worker thread which have a socket. This socket is listened in a while loop and screen is updated when a Bitmap object is read form stream. The players can enter their guesses in the text field below the panel and send their guesses to the server. But we could not implement it correctly yet. Our prototype was really beneficial for understanding the C# and .NET programming. Our final program will be much more complex which will do many things in parallel. So it is crucial for us to learn concurrent programming and synchronization mechanisms of C# and also have a good exception handling mechanisms in our program. This prototype demo can be shown to the instructor if needed. 9 EEE436 / CS422: Group 2 Progress Report 1 5. References [1] http://windowsclient.net/wpf/default.aspx [2] ftp://reports.stanford.edu/pub/cstr/reports/csl/tr/98/769/CSL-TR-98-769.pdf [3] http://ieeexplore.ieee.org/stamp/stamp.jsp?tp=&arnumber=1404819&userType=inst [4] http://drops.dagstuhl.de/opus/volltexte/2005/213/pdf/Workshop_Report_05152.pdf [5] http://www.cs.bilkent.edu.tr/~korpe/lab/medhoc.doc.pdf [6] http://www.computer.org/portal/web/csdl/doi?doc=abs%2Fproceedings%2Fipdps%2F2003 % 2F1926%2F00%2F19260032babs.htm 10