1 / 35

Handling Multiple Clients and Routing Protocols in Computer Networks

This outline covers the key concepts and practical exercises from the COS 461 Computer Networks course in Spring 2013. Focused on managing multiple client connections using the fork() method, it details the steps for accepting connections, creating child processes for handling requests, and maintaining parent process connections. The course further delves into Wireshark practices for packet analysis, including applying filters and examining protocol headers. It also discusses various routing protocols, emphasizing link-state and distance-vector protocols, along with questions relevant to their functionalities.

alayna
Télécharger la présentation

Handling Multiple Clients and Routing Protocols in Computer Networks

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. RoutingRecitation #3 COS 461: Computer Networks Spring 2013

  2. Outline Fork() Wireshark Practice routing questions

  3. Handle Multiple Clients using fork() • Steps to handle multiple clients • Go to a loop and accept connections using accept() • After a connection is established, call fork() to create a new child process to handle it • Go back to listen for another socket in the parent process • close() when you are done

  4. while (1) { fd = accept (srv_fd, (struct sockaddr *) &caddr, &clen); ... pid = fork(); children++; /* child process to handle request */ if (pid == 0) { /* exit(0) on success, exit(1) on error */ } /* parent process */ else if (pid > 0) { while ((waitpid(-1, &status, WNOHANG)) > 0) children--; if (children > MAX_PROCESSES) ... } else { perror("ERROR on fork"); exit(1); }}

  5. Wireshark • Selecting and listening on interface • Root for promiscuous mode: sniff on neighbors! • Writing filters to select packets • “udp.dstport == 53”, “http.request_method is present” • Examining packet formats • Look at Ethernet, IP, TCP, HTTP headers • Following TCP streams • Trace HTTP request(s) belonging to a TCP connection

  6. Questions

  7. b (a,?) c (a,?) d (a,?) e (a,?) f (a,?) Link State (Djikstra’s) dest link 6 e d 4 22 7 b c 7 10 18 f a 4

  8. b (a,b) c (a,?) d (a,?) e (a,?) f (a,?) Link State (Djikstra’s) dest link 6 e d 4 22 7 b c 7 10 18 f a 4

  9. b (a,b) c (a,f) d (a,?) e (a,?) f (a,?) Link State (Djikstra’s) dest link 6 e d 4 22 7 b c 7 10 18 f a 4

  10. b (a,b) c (a,f) d (a,f) e (a,?) f (a,?) Link State (Djikstra’s) dest link 6 e d 4 22 7 b c 7 10 18 f a 4

  11. b (a,b) c (a,f) d (a,f) e (a,f) f (a,?) Link State (Djikstra’s) dest link 6 e d 4 22 7 b c 7 10 18 f a 4

  12. b (a,b) c (a,f) d (a,f) e (a,f) f (a,f) Link State (Djikstra’s) dest link 6 e d 4 22 7 b c 7 10 18 f a 4

  13. Which routing protocol requires the least amount of state on the router? link state distance vector path vector

  14. Which routing protocol requires the least amount of state on the router? link state distance vector path vector

  15. Which of the following, if true, ensures packets from a to e always traverse c? A. Y > 3 B. Y > X + 1 C. Y > X D. A or B

  16. Which of the following, if true, ensures packets from a to e always traverse c? A. Y > 3 B. Y > X + 1 C. Y > X D. A or B

  17. Which of the following, if true, ensurespackets from b to e always traverse d? A. Y > 2 B. Y > X + 1 C. Y > X D. A or B

  18. Which of the following, if true, ensurespackets from b to e always traverse d? A. Y > 2 B. Y > X + 1 C. Y > X D. A or B

  19. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Initial Routing table at E

  20. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Initial Routing table at E

  21. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Initial Routing table at E

  22. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Initial Routing table at E

  23. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Initial Routing table at E

  24. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after one iteration

  25. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after one iteration

  26. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after one iteration

  27. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after one iteration

  28. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after one iteration

  29. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after two iterations

  30. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after two iterations

  31. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after two iterations

  32. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after two iterations

  33. Distance Vector Routing B 18 C 11 21 5 12 A D E 15 17 Routing table at E after two iterations

  34. Distance Vector Routing B 18 C 11 X 5 12 A D E 15 17 For what value of x does the routing table at E not change anymore after two iterations? • For all X >= 2 • For all X >= 3 • For all X <= 4 • For all X <= 3

  35. Distance Vector Routing B 18 C 11 X 5 12 A D E 15 17 For what value of x does the routing table at E not change anymore after two iterations? • For all X >= 2 • For all X >= 3 • For all X <= 4 • For all X <= 3

More Related