Presentation is loading. Please wait.

Presentation is loading. Please wait.

COS 461: Computer Networks Spring 2013

Similar presentations


Presentation on theme: "COS 461: Computer Networks Spring 2013"— Presentation transcript:

1 COS 461: Computer Networks Spring 2013
Routing Recitation #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);
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 Link State (Djikstra’s)
dest link b (a,?) 6 e d c (a,?) 4 22 7 d (a,?) b c 7 10 18 e (a,?) a f 4 f (a,?)

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

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

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

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

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

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?
B. Y > X + 1 C. Y > X D. A or B D

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

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

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

19 Distance Vector Routing Initial Routing table at E
18 C 21 11 12 5 A D E 15 17 Initial Routing table at E Destination Cost Next Hop A B C D

20 Distance Vector Routing Initial Routing table at E
18 C 21 11 12 5 A D E 15 17 Initial Routing table at E Destination Cost Next Hop A Inf --- B C D

21 Distance Vector Routing Initial Routing table at E
18 C 21 11 12 5 A D E 15 17 Initial Routing table at E Destination Cost Next Hop A Inf --- B C D

22 Distance Vector Routing Initial Routing table at E
18 C 21 11 12 5 A D E 15 17 Initial Routing table at E Destination Cost Next Hop A Inf --- B C 11 D

23 Distance Vector Routing Initial Routing table at E
18 C 21 11 12 5 A D E 15 17 Initial Routing table at E Destination Cost Next Hop A Inf --- B C 11 D 17

24 Distance Vector Routing Routing table at E after one iteration
18 C 21 11 12 5 A D E 15 17 Routing table at E after one iteration Destination Cost Next Hop A Inf --- B C 11 D 17

25 Distance Vector Routing Routing table at E after one iteration
18 C 21 12 5 11 A D E 15 17 Routing table at E after one iteration Destination Cost Next Hop A 32 D B Inf --- C 11 17

26 Distance Vector Routing Routing table at E after one iteration
18 C 21 12 5 11 A D E 15 17 Routing table at E after one iteration Destination Cost Next Hop A 32 D B 29 C 11 17

27 Distance Vector Routing Routing table at E after one iteration
18 C 21 12 5 11 A D E 15 17 Routing table at E after one iteration Destination Cost Next Hop A 32 D B 29 C 11 17

28 Distance Vector Routing Routing table at E after one iteration
18 C 21 12 5 11 A D E 15 17 Routing table at E after one iteration Destination Cost Next Hop A 32 D B 29 C 11 16

29 Distance Vector Routing Routing table at E after two iterations
18 C 21 12 5 11 A D E 15 17 Routing table at E after two iterations Destination Cost Next Hop A 32 D B 29 C 11 16

30 Distance Vector Routing Routing table at E after two iterations
18 C 21 12 5 11 A D E 15 17 Routing table at E after two iterations Destination Cost Next Hop A 31 C B 29 11 D 16

31 Distance Vector Routing Routing table at E after two iterations
18 C 21 12 5 11 A D E 15 17 Routing table at E after two iterations Destination Cost Next Hop A 31 C B 28 11 D 16

32 Distance Vector Routing Routing table at E after two iterations
18 C 21 12 5 11 A D E 15 17 Routing table at E after two iterations Destination Cost Next Hop A 31 C B 28 11 D 16

33 Distance Vector Routing Routing table at E after two iterations
18 C 21 12 5 11 A D E 15 17 Routing table at E after two iterations Destination Cost Next Hop A 31 C B 28 11 D 16

34 Distance Vector Routing
B 18 C X 12 5 11 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 X 12 5 11 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


Download ppt "COS 461: Computer Networks Spring 2013"

Similar presentations


Ads by Google