solution

advertisement
2) Installing a Linux distribution on your PC: Install a newest Linux distribution, and
summarize: (1) its installation process and (2) things (e.g. tools, documents, packages, etc)
inside a Linux distribution.
Answer:
(1) installation
a. Download DVD/CD image(ex:iso) from mirror site and burn it.
b. Boot computer with the media you burned
c. Configure time zone, language, keyboard layout…etc
d. Create partitions to be installed
e. Install boot loader, if necessary
f. Install OS and reboot
(2) documents, tools, packages.
a. tools: rdesktop, openoffice, vi, etc.
b. documents: man, info.
c. packages : aptitude, (you can use dpkg -l)
3) Source tree analysis: First read Appendix A. Then lookup the programs under /src, /usr/src, or
other directories where the source files reside depending on the Linux distribution used;
summarize and categorize what's inside that directory.
Answer:
In a general source tree:
Linux
arch
lib
kernel
drivers
fs
include
scripts
Init
crypto
ipc
arch: support processors such as alpha, arm, etc.
lib : general libraries for data structure
kernel: kernel source code.
Drivers: System driver source code.
fs: file system source code
Include: provide the libraries of headers to be included by programs.
script : scripts to check configure files and packages
Crypto: cryptographic library and source code
ipc : inter process communication source code
6. Tracing source code for sk_buff: Either dynamically or statically, trace the Linux kernel code
to find:
(a) which function calls alloc_skb to allocate sk_buff to send the request and receive the
response, in Figure 1.19,
(b) which function calls kfree_skb to release sk_buff to send the request and receive the response,
in Figure 1.19,
(c) which function calls alloc_skb to allocate sk_buff in Figure 1.20, and
(d) which function calls kfree_skb to release sk_buff in Figure 1.20. Also explain how you trace
these dynamically or statically.
Answer:
(a) [driver]e1000_setup_desc_rings() in drivers/net/e10000/e1000_ethtool.c while setting
TX/RX buffers
[tcp/ip]tcp_collapse() in net/ipv4/tcp_input.c while collapsing contiguous sequence of
socket buffer
[tcp/ip]tcp_send_ack() and tcp_xmit_probe_skb() in net/ipv4/tcp_output.c
(b) tcp_close() in /net/ipv4/tcp.c
tcp_ofo_queue(), tcp_data_queue(), tcp_collapse() in net/ipv4/tcp_input.c
(c) inet_rtm_getroute() in net/ipv4/route.c
(d) inet_rtm_getroute() in net/ipv4/route.c
Trace source code statically: use vim, grep, sourceInsight, etc.
Trace source code dynamically: use kgdb.
Written
1. Consider a transcontinental link of 5000 miles with a bandwidth of 40 Gbps. Assume the
propagation speed is 2 x 108 m/sec.
(a) What is the width of one bit in time and in length, respectively?
(b) How many bits can be contained in the link at most?
(c) What is the transmission time of a packet of 1500 bytes?
(d) What is the propagation time through this link?
Answer:
(a) bit width = 1 / (40 x 109) = 0.025 ns
bit length = 0.025 x 10-9 x 2 x 108 = 5 x 10-3 m = 0.5 cm
(b) 5000 x 1.6 x 103 / (5 x 10-3) = 1.6 x 109 = 1.6 Gb
(c) 1500 x 8 / (40 x 109) = 300 x 10-9 = 300 ns, or 1500 x 8 x 0.025 ns = 300 ns
(d) 5000 x 1.6 x 103 / (2 x 108) = 40 x 10-3 = 40 ms, or 1.6 Gb x 0.025 ns/b = 40 ms
5. Suppose that there are 3,000,000 new phone call arrivals per minute to the switched
telephone system world wide, with each call lasts for 5 minute on the average, and there are 6
hops (i.e. 6 links and 6 nodes) on the average between the callers and callees. How many
memory entries are occupied on the average to support the switched connectivity world
wide?
Answer:
3,000,000 x 5 x 6 = 90 million memory entries
10. Here we compare the overhead of routing packets and switching packets. Why is the time
complexity of routing higher than switching, while the space complexity of switching higher
than routing?
Answer:
Time: indexing in switching but matching in routing
Space: per-flow entries in switching but no per-flow entries in routing
17. In Figure 1.13, why do we put the routing task as a daemon in the user space while keeping
the routing table lookup in the kernel? Why not putting both in the user space or the kernel?
Answer:
Routing: complicate computation executed occasionally
Table lookup: fast handling required
Both in user space: slow down
Both in kernel space: unstable kernel
Download