routing recitation #3
DESCRIPTION
Routing Recitation #3. COS 461: Computer Networks Spring 2013. Outline. Fork() Wireshark Practice routing questions. Handle Multiple Clients using fork(). Steps to handle multiple clients Go to a loop and accept connections using accept() - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/1.jpg)
RoutingRecitation #3
COS 461: Computer NetworksSpring 2013
1
![Page 2: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/2.jpg)
Outline• Fork()
• Wireshark
• Practice routing questions
2
![Page 3: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/3.jpg)
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
3
![Page 4: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/4.jpg)
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);
}}
4
![Page 5: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/5.jpg)
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
5
![Page 6: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/6.jpg)
Questions
6
![Page 7: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/7.jpg)
a
c
f
b
de b (a,?)
c (a,?)d (a,?)e (a,?)f (a,?)
linkdest
22
6
4
77
4
1810
Link State (Djikstra’s)
![Page 8: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/8.jpg)
a
c
f
b
de b (a,b)
c (a,?)d (a,?)e (a,?)f (a,?)
linkdest
22
6
4
77
4
1810
Link State (Djikstra’s)
![Page 9: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/9.jpg)
a
c
f
b
de b (a,b)
c (a,f)d (a,?)e (a,?)f (a,?)
linkdest
22
6
4
77
4
1810
Link State (Djikstra’s)
![Page 10: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/10.jpg)
a
c
f
b
de b (a,b)
c (a,f)d (a,f)e (a,?)f (a,?)
linkdest
22
6
4
77
4
1810
Link State (Djikstra’s)
![Page 11: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/11.jpg)
a
c
f
b
de b (a,b)
c (a,f)d (a,f)e (a,f)f (a,?)
linkdest
22
6
4
77
4
1810
Link State (Djikstra’s)
![Page 12: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/12.jpg)
a
c
f
b
de b (a,b)
c (a,f)d (a,f)e (a,f)f (a,f)
linkdest
22
6
4
77
4
1810
Link State (Djikstra’s)
![Page 13: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/13.jpg)
Which routing protocol requires the least amount of state on the
router?a) link stateb) distance vectorc) path vector
13
![Page 14: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/14.jpg)
Which routing protocol requires the least amount of state on the
router?a) link stateb) distance vectorc) path vector
14
![Page 15: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/15.jpg)
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
![Page 16: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/16.jpg)
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
![Page 17: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/17.jpg)
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
![Page 18: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/18.jpg)
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
![Page 19: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/19.jpg)
Initial Routing table at E
Destination Cost Next Hop
A
B
C
D
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
![Page 20: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/20.jpg)
Initial Routing table at E
Destination Cost Next Hop
A Inf ---
B
C
D
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
![Page 21: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/21.jpg)
Initial Routing table at E
Destination Cost Next Hop
A Inf ---
B Inf ---
C
D
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
![Page 22: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/22.jpg)
Initial Routing table at E
Destination Cost Next Hop
A Inf ---
B Inf ---
C 11 C
D
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
![Page 23: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/23.jpg)
Initial Routing table at E
Destination Cost Next Hop
A Inf ---
B Inf ---
C 11 C
D 17 D
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
![Page 24: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/24.jpg)
Routing table at E after one iteration
Destination Cost Next Hop
A Inf ---
B Inf ---
C 11 C
D 17 D
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
![Page 25: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/25.jpg)
Destination Cost Next Hop
A 32 D
B Inf ---
C 11 C
D 17 D
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
Routing table at E after one iteration
![Page 26: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/26.jpg)
Destination Cost Next Hop
A 32 D
B 29 C
C 11 C
D 17 D
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
Routing table at E after one iteration
![Page 27: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/27.jpg)
Destination Cost Next Hop
A 32 D
B 29 C
C 11 C
D 17 D
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
Routing table at E after one iteration
![Page 28: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/28.jpg)
Destination Cost Next Hop
A 32 D
B 29 C
C 11 C
D 16 C
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
Routing table at E after one iteration
![Page 29: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/29.jpg)
Destination Cost Next Hop
A 32 D
B 29 C
C 11 C
D 16 C
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
Routing table at E after two iterations
![Page 30: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/30.jpg)
Destination Cost Next Hop
A 31 C
B 29 C
C 11 C
D 16 C
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
Routing table at E after two iterations
![Page 31: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/31.jpg)
Destination Cost Next Hop
A 31 C
B 28 C
C 11 C
D 16 C
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
Routing table at E after two iterations
![Page 32: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/32.jpg)
Destination Cost Next Hop
A 31 C
B 28 C
C 11 C
D 16 C
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
Routing table at E after two iterations
![Page 33: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/33.jpg)
Destination Cost Next Hop
A 31 C
B 28 C
C 11 C
D 16 C
AA EEDD
CCBB18
21 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
Routing table at E after two iterations
![Page 34: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/34.jpg)
For what value of x does the routing table at E not change anymore after two iterations?
AA EEDD
CCBB18
X 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
(a)For all X >= 2 (b)For all X >= 3(c)For all X <= 4(d)For all X <= 3
![Page 35: Routing Recitation #3](https://reader034.vdocument.in/reader034/viewer/2022042703/56814f89550346895dbd43da/html5/thumbnails/35.jpg)
For what value of x does the routing table at E not change anymore after two iterations?
AA EEDD
CCBB18
X 12 5 11
1715
Distance Vector RoutingDistance Vector Routing
(a)For all X >= 2 (b)For all X >= 3(c)For all X <= 4(d)For all X <= 3