1 / 18

IERG4180 Tutorial 5

IERG4180 Tutorial 5. Jim. Outline. Assignment 2 – NetProbe Client-Server Edition S pecifications Implementations Marking scheme Submission requirements. Specifications. Extend NetProbe of your assignment 1 into:

lucien
Download Presentation

IERG4180 Tutorial 5

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. IERG4180 Tutorial 5 Jim

  2. Outline • Assignment 2 – NetProbe Client-Server Edition • Specifications • Implementations • Marking scheme • Submission requirements

  3. Specifications • Extend NetProbe of your assignment 1 into: • Server Mode and Client Mode(you can keep the hostInfo here, but we won’t count this part) • Your source code has to be compilable and executable in both Linux and Windows • Client side • Send requests(rate, packet size, etc.) to server, and then receive response from server • Display statistics • Server side • Wait for new incoming requests • When there is one, use another thread to handle the request • Display connection information

  4. Communication Flow Client Server Request as metadata: Rate, protocol, etc. Send Request Send Respond ...

  5. Client Side Program Flow Display thread Process thread Client Server Show Stat. WSAStartup() Send Request Socket() Send Respond connect() ... send() recv() closesocket() WSACleanup() For Windows TCP case. Similar for Linux case. Similar for UDP case.

  6. Server Side Program Flow Thread 2 Thread 3 Thread 1 WSAStartup() Show Info. TCP Connection UDP Connection Socket() bind() listen() accept() process For Windows TCP case. Similar for Linux case. Similar for UDP case.

  7. Server Side Program Flow Client Server New Thread Send Request recv() Send Respond send() ... closesocket() accept() process For Windows TCP case. Similar for Linux case. Similar for UDP case.

  8. Server Side Program Flow Thread 3 Show Info. New Thread recv() A class/data structure Record elapsed time, sent packet send() closesocket() accept() Count the number of TCP Connections with Mutex process For Windows TCP case. Similar for Linux case. Similar for UDP case.

  9. Program Flow • You can have your own program design, as long as it fulfills the specification • Ask tutors if you are not sure

  10. Multi-thread • A Portable Threading Library: http://tinycthread.bitsnbites.eu/ • tinycthread.h, tinycthread.c (you may have to rename as .cpp) • More on lecture notes and the following reference: http://tinycthread.bitsnbites.eu/doc/tinycthread_8h.html

  11. Reminders • Your thread function must follow: • intyour_funciton(void *arg) • Declare your thread function as static if it is a class member function (refer to lecture 4 p.52-54) • Check you are using Multithreaded Run-time Library

  12. Reminders • You might have to link –pthread for Linux. In Eclipse:

  13. Portability • Refer to tutorial4 slide19-20

  14. es_Timer • http://course.ie.cuhk.edu.hk/~ierg4180/project/es_TIMER.zip • Only require es_TIMER.h • add '-lrt' to linker to link with the RT timer lib • For Eclipse, go to Project > Properties to set

  15. es_Timer

  16. es_Timer

  17. Marking Scheme • http://course.ie.cuhk.edu.hk/~ierg4180/project/IERG4180_Assignment2_marking_scheme.pdf • Remark: Documentation is important • Later if you work as a developer… • Your effort will be wasted if your colleagues don’t understand how to proceed with your code • And now if I don’t know what to do with your source files, I can’t grade your assignment! • So, take it seriously

  18. Submission requirements • You must use Centos 6.4 as your Linux platform • I assume you use VS2010 for Windows; Eclipse for Centos 6.4 • If you want to use VS2012, you can • If you want to use vim and compile with gcc in Linux, you can • What to submit: • Submit your source code, together with a clear enough documentation on how to use your code (starting from creating new project, adding your codes to the project, making any additional settings (e.g. the es_TIMER), to compiling your code (if you use any IDE); if you use gcc, tell me how to make your executable • Submit your experimental results as well • Late submission policy • Same as assignment 1

More Related