Advertisement
Guest User

Untitled

a guest
Nov 24th, 2015
1,443
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 41.32 KB | None | 0 0
  1. \documentclass[9pt,landscape, fleqn]{article}
  2. \usepackage{multicol}
  3. \usepackage[T1]{fontenc}
  4. %\usepackage[utf8]{inputenc}
  5. \usepackage[icelandic]{babel}
  6. \usepackage{calc}
  7. \usepackage[shortlabels]{enumitem}
  8. \usepackage{ifthen}
  9. \usepackage[landscape]{geometry}
  10. \usepackage{hyperref}
  11. \usepackage{tikz}
  12. \usetikzlibrary{automata,positioning}
  13. \usepackage{amsmath}
  14. \usepackage{amssymb}
  15. \usepackage{leftidx}
  16. %\usepackage[utf8]{inputenc}
  17. %\usepackage[icelandic]{babel}
  18. %\usepackage[T1]{fontenc}
  19. \usepackage{graphicx}
  20. \usepackage{color}
  21. \newcommand{\itab}[1]{\hspace{0em}\rlap{#1}}
  22. \newcommand{\tab}[1]{\hspace{.2\textwidth}\rlap{#1}}
  23. %\usepackage{inputenc}
  24.  
  25.  
  26. % To make this come out properly in landscape mode, do one of the following
  27. % 1.
  28. % pdflatex latexsheet.tex
  29. %
  30. % 2.
  31. % latex latexsheet.tex
  32. % dvips -P pdf -t landscape latexsheet.dvi
  33. % ps2pdf latexsheet.ps
  34.  
  35.  
  36. \ifthenelse{\lengthtest { \paperwidth = 11in}}
  37. { \geometry{top=.3in,left=.3in,right=.3in,bottom=.3in} }
  38. {\ifthenelse{ \lengthtest{ \paperwidth = 297mm}}
  39. {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
  40. {\geometry{top=1cm,left=1cm,right=1cm,bottom=1cm} }
  41. }
  42.  
  43. % Turn off header and footer
  44. \pagestyle{empty}
  45.  
  46.  
  47. % Redefine section commands to use less space
  48. \makeatletter
  49. \renewcommand{\familydefault}{\sfdefault}
  50. \renewcommand{\section}{\@startsection{section}{1}{0mm}%
  51. {-1ex plus -.5ex minus -.2ex}%
  52. {0.5ex plus .2ex}%x
  53. {\normalfont\large\sffamily}}
  54. \renewcommand{\subsection}{\@startsection{subsection}{2}{0mm}%
  55. {-1ex plus -.5ex minus -.2ex}%
  56. {0.5ex plus .2ex}%
  57. {\normalfont\normalsize\sffamily}}
  58. \renewcommand{\subsubsection}{\@startsection{subsubsection}{3}{0mm}%
  59. {-0.5ex plus -0.5ex minus -5.2ex}%
  60. {0.2ex plus 0.2ex}%
  61. {\normalfont\small\sffamily}}
  62. \makeatother
  63. % til að gera lista þettari
  64. \newenvironment{myitemize}
  65. { \begin{itemize}[nosep]
  66. \setlength{\itemsep}{0pt}
  67. \setlength{\parskip}{0pt}
  68. \setlength{\parsep}{0pt} }
  69. { \end{itemize} }
  70.  
  71. \newenvironment{myList}
  72. { \begin{enumerate}[nosep]
  73. \setlength{\itemsep}{0pt}
  74. \setlength{\parskip}{0pt}
  75. \setlength{\parsep}{10pt} }
  76. { \end{enumerate} }
  77.  
  78. % Define BibTeX command
  79. \def\BibTeX{{\rm B\kern-.05em{\sc i\kern-.025em b}\kern-.08em
  80. T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}}
  81.  
  82. % Don't print section numbers
  83. \setcounter{secnumdepth}{0}
  84.  
  85.  
  86. \setlength{\parindent}{0pt}
  87. \setlength{\parskip}{0pt plus 0.5ex}
  88. %\graphicspath{ {/Users/ragnalara/Desktop/} }
  89.  
  90. % -----------------------------------------------------------------------
  91. \begin{document}
  92.  
  93. \raggedright
  94. \footnotesize
  95. \begin{multicols}{4}
  96.  
  97. % multicol parameters
  98. % These lengths are set only within the two main columns
  99. %\setlength{\columnseprule}{0.25pt}
  100. \setlength{\premulticols}{1pt}
  101. \setlength{\postmulticols}{1pt}
  102. \setlength{\multicolsep}{1pt}
  103. \setlength{\columnsep}{2pt}
  104.  
  105. \textbf{Q:}Why are standards important for protocols?\\
  106. \textbf{A:} \textit{to ensure interoperability between competing implementations.}\\
  107. \textbf{Q:}List six access technologies. Classify each one as home access, enterprise access,or wide-area wireless access.\\
  108. \textbf{A:}\textit{
  109. home access:
  110. DSL, cable, FTTH, Dial-up and satillite \\
  111. enterprise access:
  112. Ethernal and WIFI\\
  113. wide-area wireless
  114. 3G, LTE a.k.a. 4G}\\
  115. \textbf{Suppose Host A wants to send a large file to Host B. The path from Host A to Host B has three links, of rates R1 = 500 kbps, R2 = 2 Mbps, and R3 = 1 Mbps\\
  116. Q:} 1. Assuming no other traffic in the network, what is the throughput for the file
  117. transfer? \\
  118. \textbf{A:}\textit{
  119. 500 kbps because = 0,5 Mbps:it only can goes as fast as the slowest link (R1 , R2, RN)}\\
  120. \textbf{Q:} 2. Suppose the file is 4 million bytes. Dividing the file size by the throughput, roughly how long will it take to transfer the file to Host B?\\
  121. \textcolor{red}{ASIDE: The transmission delay is L/R, L: packet length (bits), R: link bandwidth (bps), dtrans = L/R
  122. The Propagation Delay: d: length of physical link
  123. s: propagation speed in medium (~2x108 m/sec)
  124. dprop = d/s}\\
  125. \textbf{A:}\textit{4 million bytes* (1 byte = 8 bits) = 32 million bits AND (1 Kbps = 1000 bps)\\
  126. -> 32 mil bits / 500.000 bps = 64 sec}
  127. \[
  128. \frac{L-bits}{R} = \frac{4*MB*8bit}{0.5 Mbps} = \frac{32 kbits}{0.5 Mbps} = 64 sec\]
  129.  
  130. \textbf{Q:}How long does it take a packet of length 1000 bytes to propagate over a link
  131. of distance 2500 km, propagation speed 250 Mm/s, and transmission rate 2 Mbps? More
  132. generally, how long does it take a packet of length L to propagate over a link of distance d, propagation speed v, and transmission rate R? Does this delay depend on packet length?
  133. Does this delay depend on transmission rate?\\
  134. \textbf{A:}
  135. $d_{proc}$ the time it takes a bit to propagate from one router to the next $d_{trans}$ the time required for the router to push out the packet. While the bit propagation delay is independent of packet length and transmission rate,the time for a packet to propagate depends on both packet size and transmission rate.
  136. \[
  137. d_{node} = d_{proc}+ d_{queue}+ d_{trans}+ d_{drop}\]
  138. \[
  139. d_{trans} = \frac{L}{R} = \frac{1000 b}{2Mbps} =
  140. \frac{1 kb*8}{2Mbps}=4 ms\]
  141. \[
  142. d_{prop} = \frac{d}{v} =\frac{2500 km}{250Mm/s} = \frac{2500*1000m }{250*10^6 m/s} =0.01 s\]
  143. \[ = 4ms + 10 ms = 14ms\]
  144. the sum of transmission and propagation delay (to make sure the whole packet actually arrives and not only its first bit). An answer that each bit of the packet takes 10 ms is accepted, as long as it is consistent, and it is not multiplied by the packet size.\\
  145. \textbf{Suppose users share a 3 Mbps link. Also suppose each user requires 150 kbps when transmitting, but each user transmits only 10 percent of the time.}\\
  146. \textbf{Q:} When circuit switching is used, how many users can be supported?
  147. \[
  148. \textbf{A:} \frac{3Mbps*1000kbps/Mb}{150kbps} = 20 users\]
  149. \textbf{Profspurning Q:}Suppose there is a 1 Mbit/s microwave link between a geostationary satellite and its
  150. base station on Earth (distance of about 36 Mm). Every 30 seconds, the satellite takes a
  151. digital photo and sends it to the base station. Assume a propagation speed of 240 Mm/s. \textbf{Q:}What is the propagation delay of the link?
  152. \[
  153. \frac{36Mm}{240Mm/s} = 0.15s
  154. \]
  155. \textbf{Q:}What is the bandwidth-delay product, R*d$_{prop}$?
  156. \[
  157. 1Mb/s * 0.15s = 0.15 Mbits
  158. \]
  159. \textbf{Q:}Let x denote the size of the photo. What is the minimum value of x for the microwave link to be continuously transmitting?
  160. \[
  161. 30s* 1 Mb/s = 3.75 MB \approx 3.576 MiB\]
  162. \textbf{What are the five layers in the Internet protocol stack? What are the principal responsibilities of each of these layers? and protocols}\\
  163. \textbf{Application layer} application interoperability, Protocol: DNS, HTTP, SMTP \\
  164. \textbf{Transport layer} reliability, Protocol: UDP,TCP \\
  165. \textbf{network layer} routing, Protocol: IP\\
  166. \textbf{link layer} transfer from host/router to host/routerrouter, Protocol: OSPF, DOCSIS and CSMA/CD\\
  167. \textbf{physical layer.} protocols for signal representation between links.
  168. \textbf{Application Layers}\\
  169. \textbf{Q:}What is the difference between network architecture and application architecture?\\
  170. \textbf{A:}\textit{The application architecture is designed by the application developer and dictates how the application is structured over the various end systems, e.g. client- server or peer-to-peer.\\ A network architecture provides a specific set of services to an application.}\\
  171. \textbf{Q:}A popular social networking site can quickly become over whelmed if it has only one server handling all of its requests. How is this tackled in practice\\
  172. \textbf{A:}\textit{Data centers, A large number of hosts in a data centre can be used to create a powerful virtual server.}\\
  173. \textbf{UDB} Suppose you want to do transmission from a remote client to a server as fast as possible. \textbf{its UDB}\\
  174. It has little overhead and no congestion control or flow control, i.e. all messages can be used for file transfer. If nothing goes wrong, it will be fastest. Only if errors become more likely, once may consider TCP.\\
  175. Recall that TCP can be enhanced with SSL to provide process-to-process security services, including encryption.\\
  176. \textbf{Does SSL operate at the transport layer or the application layer?}\\
  177. Application layer.\\
  178. \textbf{Q:}how will TCP to be enhanced with SSL,\\
  179. \textbf{A:}\textit{Link to openssl (e.g.) and use their API.
  180. -if an application wants to use the services of SSL, it needs to include SSL code (existing, highly optimized libraries and classes) in both the client and server sides of the application } \\
  181. \textbf{What is the main purpose of DNS? What other services does it provide? Name at least two.}\\
  182. DNS can be used to translate host names to IP addresses. It provides a distributed database to map host names to IP addresses.\\
  183. \textbf{Name two record types of DNS and briefly explain the meaning of their fields.
  184. }\\
  185. A, NS, CNAME, MX\\
  186. How is the reliability and scalability of \textbf{DNS} guaranteed?\\
  187. Data is distributed and cached. By distribution, the system avoids a single point of failure. Caching avoids traffic to authoritative servers and if one server fails, can provide data in its place.\\
  188. \textbf{Which transport protocol is used by DNS? Why?}\\
  189. UDP for packets of small size (usually below 512 bytes) and TCP for larger ones.
  190. UDP is faster and the implementation is simpler for UDP. Also, the load on a server is lower for UDP, the sender can handle more requests in the same time as TCP.\\
  191. \textbf{i visit http://theendofinternet.com/}\\
  192. The application-layer protocols are used :DNS for name resolution, HTTP for downloading the web page at the IP address.\\
  193. Which application layer messages are sent and received from your computer (in order) Name the type of message, sender, receiver , the content and purpose of the message.?\\
  194. \begin{myList}
  195. \item DNS request for the ip address of the end of internet.com (type A) from my machine to the local DNS server (recursive request)
  196. \item DNS response of type A with the ip address of theendofinternet.com from the local DNS server to my machine
  197. \item HTTP GET request from my browser to IP address of the end of internet.com, port 80 GET / HTTP/1.1 Host: theendofinternet.com.
  198. \item HTTP response with code200 from the webserver to the browser containing the web page
  199. \item HTTP GET request from my browser to IP address of the end of internet.com, port 80 GET /best with.gif HTTP/1.1 Host: theendofinternet.com
  200. \item HTTP response with code 200 from the web server to the browser containing the image
  201. \end{myList}\\
  202. \textbf{HW6}
  203. \textbf{Q:} The Ethernet frame begins with an 8-byte preamble field. The purpose of the first 7 byte is to 'wake up' the receiving adapters and to synchronize their clocks to that of the senders clock. What are the contents of the 8 bytes?
  204. What is the purpose of the last byte?\\
  205. \textbf{Solution:}We see 7 times 0xAA, followed by 0xAB. The purpose of this last byte is to mark the end of the preamble and to indicate that the frame contents follows.\\
  206. \textbf{Q:} The switch table is initially empty. Show the state of the switch table before and after each of these events. For each of these events, identify the link(s) on which the transmitted frame will be forwarded, and briefly justify your answers.\\
  207. Let's consider the operation of a learning
  208. switch in the context of a network in which 6 nodes labelled A through F are star connected into an Ethernet switch. Suppose that:\\
  209. 1. B sends a frame to E
  210. 2. E replies with a frame to B
  211. 3. A sends a frame to B
  212. 4. B replies with a frame to A\\
  213.  
  214. \textbf{Solution:}
  215. 1. Switch learns interface to B, broadcasts to A, C, D, E, and F. The switch does
  216. not know the link to E.
  217. 2. Switch learns interface to E, sends to B, because B is already known.
  218. 3. Switch learns interface to A, sends to B, because B is already known.
  219. 4. Switch state remains the same as before, sends to A, because A is already known\\
  220. }
  221.  
  222.  
  223.  
  224.  
  225.  
  226. \textcolor{red}{all browsers are persitent!!}
  227. \textbf{Which transport layer protocols are used for which of the application layer messages?}\\
  228. HTTP uses TCP and DNS uses UDP\\
  229. \begin{tabular}{| l |c|}
  230. \hline
  231. Mac address & $2^{48}$\\
  232. IPv4 & $2^{32}$\\
  233. IPv6 & $2^{128}$\\
  234. \hline
  235. \end{tabular}\\
  236. \textbf{UDP checksum
  237. }3* 16 bitar ord.
  238. Tek summuna af fyrstu 2, svo seinasta ordid og legg saman vid summuna i fyrri lid, tek svo compliment
  239. ef utkoman er ekki allt 111111.. tha er error\\
  240.  
  241.  
  242.  
  243.  
  244.  
  245. \newpage
  246. \textbf{Transport Layer}\\
  247. \textbf{UDP multiplexing/demultiplexing}\\
  248. HOST A with UDP port 19157\\
  249. HOST B with UDP port 46428\\
  250. \begin{myList}
  251. \item The transport layer in Host A creates a transport-layer segment that includes the application data, the source port number is 19157 and dest port number is 46428
  252. \item The transport layer then passes that same segment to network layer
  253. \item The network layer encapsulates the segment in an \textbf{IP} datagram and makes a best-effort attempt to deliver the segment to the receiving host
  254. \item If the segment arrives at the receiving Host B, the transport layer at the receiving host examines the destination dest port number the segment (46428) (Note that Host B could be running multiple processes, each with its own UDP socket and associated port number.)
  255. \item As UDP segments arrive from the network, Host B directs (demultiplexes) each segment to the appropriate socket by examining the segment’s destination port number.
  256. \end{myList}
  257. 2 UDP segments have different source IP addresses and/or source port numbers, but have the same destination IP address and destination port number, then the two segments will be directed to the same destination process via the same destination socket. \\
  258. \textbf{3. TCP Protocol
  259. (a) (20 points)} Assume we send \textcolor{red}{4000 bytes of data}. Display the temporal sequence of all TCP segments send from sender to receiver. For each message, indicate the TCP flags set in the header, the sequence number and the ACK number. Assume an\textcolor{red}{ MTU of 1500 bytes}. Do not forget connection establishment and connection tear-down. Assume that there is no congestion and no packet loss. \textcolor{red}{Let the receive window of the receiver be 5000 bytes large.}\\
  260. \textcolor{red}{PLEASE NOTE!\\
  261. Hedaer size is 20, 8 for UDP, 40 IP\\
  262. ACK = number of data we have recieved\\
  263. Everytime we send Empty ACK Messages we increment counter by 1}\\
  264. \textbf{The sequence number} for a segment is therefore the byte-stream number of the 1'st byte in the segment. The first segment gets assigned sequence number 0
  265. Suppose that a process in Host A wants to send a stream of data to a process in Host B over a TCP connection.\\
  266. \textbf{The acknowledgment number} that Host A puts in its segment is the sequence number of the next byte Host A is expecting from Host B.
  267. \textbf{MSS(Maximum Segment Size)}
  268. The optional and variable-length options field is used when a sender and receiver negotiate the maximum segment size (MSS) or as a window scaling factor for use in high-speed networks.\\
  269. \includegraphics[width=0.3\textwidth]{ja.png}\\
  270. \textbf{TCP flow control:}\\
  271. receiver controls sender, so sender wont overflow receivers buffer by transmitting too much, too fast\\
  272. receiver advertises free buffer space by including rwnd value in TCP header of receiver-to-sender segments\\
  273. The receiver indicates whether its receive buffer overflow by announcing the receive window size in acknowledgement packets\\
  274. \includegraphics[width=0.2\textwidth]{hallo.png}\\
  275. \textbf{TCP congestion control: additive increase}\\
  276. approach: sender increases transmission rate (window size), probing for usable bandwidth, until loss occurs \textcolor{blue}{5-15 and 16-22}\\
  277. the receiver measures through time outs and triplicate acknowledgement whether the bandwidth is sufficient, and throttles the data rate accordingly.\\
  278. \textit {additive increase: increase cwnd by 1 MSS every RTT until loss detected\\
  279. multiplicative decrease: cut cwnd in half after loss}\\
  280. \textbf{TCP Slow Start} \textcolor{blue}{0-5 and 22-24}
  281. when connection begins, increase rate exponentially until first loss event:\\
  282. \textit {initially cwnd = 1 MSS\\
  283. doublecwndevery RTT\\
  284. done by incrementing cwnd for every ACK received} \\
  285. summary: initial rate is slow but ramps up exponentially fast\\
  286.  
  287. \textbf{TCP: detecting, reacting to loss}\\
  288. loss indicated by timeout: \textcolor{blue}{After 22th transmission round}\\
  289. \textit {cwnd set to 1 MSS\\
  290. window then grows exponentially (as in slow start) to threshold, then grows linearly}\\
  291. loss indicated by 3 duplicate ACKs: TCP RENO \textcolor{blue}{After 16th transmission round}\\
  292. \textit {dup ACKs indicate network capable of delivering some segments
  293. cwnd is cut in half window then grows linearly}\\
  294. TCP Tahoe always sets cwnd to 1 (timeout or 3 duplicate acks)\\
  295. \textcolor{blue}{6. Suppose your web browser retrieves an HTML document which references 5 very small objects on the same server. Neither the IP address of the host providing the web server nor the web page or any of the objects referenced are cached. Further, assume that 3 DNS servers have to be asked to obtain the IP address. Assume, the round trip time to any server is RTT , that is the round trip time is the same for each of the servers. Neglect transmission times and processing times.}\\
  296. \textbf{6.1} How much time elapses with non-persistent HTTP with parallel connections?\\
  297. \textbf{Solution:} DNS uses UDP (so no connection setup), thus it takes 1 RTT per DNS request. HTTP uses TCP, so each HTTP request takes at least 2 RTT (1 for SYN/SYN- ACK and 1 for ACK together with the GET request plus the reply from the server). A new connection is opened for each request (non-persistent). Before the browser can download the referenced objects, it needs to get the HTML document, to see what is referenced. Thus the 5 small objects can be downloaded in parallel, but only after the HTML was received. Thus, we need\\ 3 RTT for DNS + 2 RTT for the getting the HTML + 2 RTT for getting all the 5 referenced objects in parallel = 7 RTT.\\
  298. \textbf{6.2} How much time elapses with non-persistent HTTP without parallel connec- tions?\\
  299. \textbf{Solution:} All request are send sequentially, and a new connection is made for every request, thus we get 3 * 1 RTT (for DNS) + 6 * 2 RTT (for HTTP) = 15 RTT.\\
  300. \textbf{6.3} How much time elapses with persistent HTTP without parallel connections?\\
  301. \textbf{Solution:} All HTTP request are send sequentially, but over the same connection. Thus, connection setup needs to be done just once. We get// 3 * 1 RTT (for DNS) + 1 RTT (HTTP connection setup) + 6 * 1 RTT (for the requests) = 10 RTT\\
  302. \textbf{6.4} How much additional time would it cost if all DNS queriesused TCP instead?\\
  303. \textbf{Solution:}Then each DNS query would take 2 RTT instead of 1 RTT. Hence, 3 additional RTT.\\
  304.  
  305. \textbf{TSP header}rwnd Receive window (flow control) cwnd Congestion window (Congestion control)\\
  306. \textbf{Q:}List the four broad classes of services that a transport protocol can provide. For each of the service classes, indicate if either UDP or TCP (or both) provides such a service. \\
  307.  
  308. \textbf{A:Reliable Data Transfer:}\\
  309. TCP provides a reliable byte-stream between client and server but UDP doesn’t.
  310. \textbf{Throughput:} A guarantee that a certain value for throughput will be maintained
  311. neither.
  312. \textbf{Timing:} A guarantee that data will be delivered within a specified amount of time
  313. neither
  314. \textbf{Security:} neither
  315.  
  316. \textbf{network architecture vs application architecture?}
  317. Network architecture refers to the organisation of the communication process into layers (five-layer Internet architecture). Application architecture, is designed by an application developer and dictates the broad structure of the application (client-server or P2P)\\
  318. \textbf{Logical communication between two processes.} Application processes use the logical communication provided by the transport layer to send messages to each other,
  319. transport-layer protocol provides logical communication between processes, UDP and TCP
  320. network-layer protocol provides logical communication between hosts.
  321. An application protocol lives only in the end systems and is not present in the network core.\\
  322. \textbf{Cookies how they work}When the user first visits the site, the site returns a cookie number. This cookie number is stored on the user's host and is managed by the browser. During each subsequent visit, the browser sends the cookie number back to the site. Thus the site knows when this user (more precisely, this browser) is visiting the site. \\
  323.  
  324. \newpage
  325. \textbf{Network layer}
  326. %\begin{center}
  327. \textbf{The transport layer} provides various forms of \textit{process-to-process} communication by relying on
  328. \textbf{the network layer's}communication \textit{host-to-host service}. \\
  329. - The transport layer does not know how the network layer actually implements this service. \\
  330. \textbf{Transport-layer} packet is \textbf{segment}\\
  331. \textbf{Tetwork-layer} packet is \textbf{datagram}\\
  332. \textbf{Link-layer} packet is \textbf{frame}\\
  333. %\end{center}
  334. A router forwards a packet based on the packet's IP (layer 3) address. A link-layer switch forwards a packet based on the packet's MAC (layer 2) address.\\
  335. \textbf{SUPPOSE H1 and H2} and several routers on the path between them.
  336. \begin{enumerate}
  337. \item The network layer in H1 takes segments from the transport layer in H1, encapsulates them into a datagram (a network-layer packet) Then sends the datagrams to its nearby router, R1. \item H2(reciever), the network layer receives the datagrams from its nearby router R2, extracts the transport-layer segments, and delivers the segments up to the transport layer at H2
  338. \end{enumerate}
  339.  
  340. \textit{\textbf{4.3 What's Inside a Router?}}\\
  341. \textbf{Input ports} when
  342. given datagram dest, lookup output port using forwarding table in input port memory (match plus action)\\
  343. goal: complete input port processing at 'line speed'\\
  344. queuing: if datagrams arrive faster than forwarding rate into switch fabric\\
  345. \textbf{Switching fabric} is at the very heart of a router, connects the router's input ports to its output ports as it is through this fabric that the packets are actually switched (that is, forwarded) from an input port to an output\\
  346. switching rate\\
  347. \textit{\textbf{three types} of switching fabrics
  348. Switching via memory, bus AND interconnection network}\\
  349. \textbf{Output ports.} An output port stores packets received from the switching fabric and transmits these packets on the outgoing link by performing the necessary link-layer and physical-layer functions.\\
  350. \textbf{Q:} Describe how packet loss can occur at input ports and how packet loss at input ports can be eliminated .\\
  351. \textbf{Solution:} Packet loss occurs if queue size at the input port grows large because of slow switching fabric speed and thus exhausting router's buffer space.\\ It can be eliminated if the switching fabric speed is at least n times as fast as the input line speed, where n is the number of input ports.\\
  352. \textbf{Q:} Describe how packet loss can occur at output ports. Can this loss be prevented by increasing the switch fabric speed?\\
  353. \textbf{Solution:} Packet loss can occur if the queue size at the output port grows large because of slow outgoing line-speed.\\
  354. \textbf{Q:} Do routers have IP addresses? how many?\\
  355. \textbf{Solution:} Yes. One per interface/subnet they are routing between.\\
  356. \textbf{EXTRA:}The boundary between the router and any one of its links is called an interface. -> has multiple interfaces, one for each of its links. Because every host and router is capable of sending and receiving IP datagrams, IP requires each host and router interface to have its own IP address. Thus, an IP address is technically associated with an interface, rather than with the host or router containing that interface\\
  357. \textbf{Q:} What is the difference between routing and forwarding?\\
  358. \textbf{Solution:} Routing is the process of deciding the way a packet takes to its destination. Forwarding is the process to send the package along its route to the destination.\\
  359. \textbf{Q:} Do the routers in both datagram networks and virtual-circuit networks use forwarding tables? If so, describe them.\\
  360. \textbf{Solution:} Yes, both use forwarding tables. For a VC forwarding table, the columns are : Incoming Interface, Incoming VC Number, Outgoing Interface, Outgoing VC Number. For a datagram forwarding table, the columns are: Destination Address, Outgoing Interface.\\
  361. \textbf{Q:} Discuss why each input port in a high-speed router stores a shadow copy of the forwarding table.\\
  362. \textbf{Solution:} With the shadow copy,the forwarding decision is made locally, at each input port, without invoking the centralized routing processor. Such decentralized forwarding avoids creating a forwarding processing bottleneck at a single point within the router.\\
  363. \textbf{Q:}Suppose you purchase a wireless router and connect it to your cable modem. Also suppose that your ISP dynamically assigns your connected device (that is, your wireless router) one IP address. Also suppose that you have five PCs at home that use 802.11 to wirelessly connect to your wireless router. How are IP addresses assigned to the five PCs? Does the wireless router use NAT? Why or why not?\\
  364. \textbf{Solution:} One IP address is assigned to the router by the ISP,each of the five PC shave one IP address assigned by the router. The router uses NAT to translate connections of individual PC to connections between the router and the outside internet, because the local addresses are not accessible from outside.\\
  365. \textbf{Suppose two packets arrive to \textbf{two different input ports} of a router at exactly the same time. Also suppose there are no other packets anywhere in the router.}\\
  366. \textbf{Q:} Suppose the two packets are to be \textbf{forwarded to two different output} ports. Is it possible to forward the two packets through the switch fabric at the same time when the fabric uses a shared bus?\\
  367. \textbf{Solution: No } if multiple packets arrive to the router at the same time, each at a different input port, all but one must wait since only one packet can cross the bus at a time. \\
  368. \textbf{what about two different output ports when the fabric uses a crossbar? NO\\
  369. BUT forwarded to the same output port when the fabric uses a crossbar?\textbf{ NO}\\}
  370. \textbf{LONGEST PREFIX:} Consider a datagram network using 32-bit host addresses. Suppose a router has 4 links(0-3), and packets are to be forwarded to the link interfaces as follows: \\
  371. \textbf{Destination address range Link interface}
  372. 11100000 00000000 00000000 00000000 th. 0 \\
  373. 11100000 00111111 11111111 11111111\\
  374. 11100000 01000000 00000000 00000000 th. 1 \\
  375. 11100000 01000000 11111111 11111111 \\
  376. 11100000 01000001 00000000 00000000 th. 2 \\
  377. 11100001 01111111 11111111 11111111\\
  378. otherwise 3 \\
  379. \textbf{Q:}Provide a forwarding table that has five entries, uses longest prefix matching, and forwards packets to the correct link interfaces.\\
  380. PREFIX MATCH Link interface\\
  381. \begin{center}
  382. \begin{tabular}{ |c|c| }
  383. \hline
  384. PREFIX MATCH & Link \\
  385. & interface\\
  386. 11100000 - 00 & 0 \\
  387. 11100000 - 01000000 & 1 \\
  388. 11100001 & 2\\
  389. 11100000 01000001 & 3\\
  390. otherwise & 4\\
  391. \hline
  392. \end{tabular}
  393. \end{center}
  394. \textbf{Q:}Describe how your forwarding table determines the appropriate link interface for datagrams with destination addresses:
  395. \textbf{Solution:longest prefix matching rule;} that is, it finds the longest matching entry in the table and forwards the packet to the lin interface associated with the longest prefix match.\\
  396. 1. 11001000 10010001 01010001 01010101\\
  397. 2. 11100001 01000000 11000011 00111100\\
  398. 3. 11100001 10000000 00010001 01110111\\
  399. 1. Prefix matches otherwise, link interface 3. \\
  400. 2.Prefix matches 1110000, link interface 2\\
  401. 3.Prefix matches 11100001 1, link interface 3.\\
  402.  
  403. \textbf{Q:}\textbf{ Consider a router that interconnects 3 subnets}. Suppose all three subnets must have the prefix \textcolor{red}{223.1.17/24}Suppose Sub1 has 125 interfaces, Sub2 has 60 and 3 have 60 interfaces. Provide 3 network addresses of the form \textcolor{red}{a.b.c.d/x} that satisfy these constraint\\
  404. \textbf{Solution:}
  405. Out of 32-bits of IP(Internet Protocol), the first 24 bits are fixed(assigned for 223.1.17), some of the last 8 bits must be used to identify the new networks.\\
  406. Therefore subnets can have IP addresses of 223.1.17.XXXX/Y, XXXX = Decimal value of last 4 bits and Y is the number of bits int the first part of address.
  407. \begin{verbatim}
  408. Sub1 has 60 interfaces, so 6 bits can
  409. support up to 64 addreses
  410. Sub2 has 90 interfaces, so 7 bits can
  411. support up to 128 addreses
  412. Sub3 has 12 interfaces so 4 bits can
  413. support up to 16 addreses
  414. \end{verbatim}
  415. 2. Subnet 2 consists of 223.1.17.0/25 to 223.1.17.127/25, host addreses ranges from 0-127(0000-0000 - 0111-1111) The address range varies by the last 7 bits out of 32-> prefix range is 32-7= 25\\
  416. 1. Subnet 1 consists of 223.1.17.128/26 to 223.1.17.192/26, host addreses ranges from 128-192(1000-0000 - 1100-0000) The address range varies by the last 6 bits out of 32-> prefix range is 32-6= 26\\
  417. 3. Subnet 2 consists of 223.1.17.193/27 to 223.1.17.209/27, host addreses ranges from 193-209(1100-0000 - 1101-0001) The address range varies by the last 6 bits out of 32-> prefix range is 32-5= 267\\
  418.  
  419. In 2nd and 3rd networks, there are 6 bits available for hosts. Thus, each of these networks can support $26^2$ or 62 hosts. Converting the binary in the last octet to decimal, the networks can be specified as follows:\\
  420. \textbf{ALMENNT} suppose 1st 21 bits of the CIDRized address a.b.c.d/21 specify the organization’s n.prefix and are common to the IP addresses of all devices in that organization. The remaining 11 bits then identify the specific hosts in the organization. The organization’s internal structure might be such that these 11 rightmost bits are used for subnetting within the organization, as discussed above. For example, a.b.c.d/24 might refer to a specific subnet within the organization. \\
  421. \textbf{Client/server versus peer-to peer.} A client process requests a service by sending one or more messages to a server process. The server process implements a service by reading the client request, performing some action (for example, in the case of an HTTP server, finding a Web page), and sending one or more messages in reply (in the case of HTTP, returning the requested object).always-on host ,permanent IP address
  422. and data centers for scaling\\
  423. suitable for
  424. \textbf{P2P}the two ends of the protocol are equal\\
  425. sutable for: File Distribution,Instant Messaging, Video Streaming, Distributed Computing\\
  426.  
  427. \newpage
  428. %%%%%%%% ný síða
  429.  
  430.  
  431.  
  432. \textbf{demultiplexing}.
  433. The mechanism of passing when a transport-layer protocol in a host receives a segment from the network layer, it must decide to which socket it is to pass the segment’s payload.
  434. \textbf{Multiplexing}
  435. At the source host, the job of gathering data chunks from different sockets, adding header information (for demultiplexing at the receiver), and passing the resulting segments to the network layer\\
  436. \textbf{ packet switching
  437. }hosts break application-layer messages into packets for transimitting, the resources are shared between host, packets can traverse different routes, be dropped by the network, can be different sizes, arrive out of order, and is reordered using tagged destination system.\\
  438. \textbf{circuit switching}circuit is established between endpoints before data passes (like a phone call), the resources are dedicated
  439.  
  440. \textbf{Q:}compare and \textbf{contrast link-state and distance-vector routing algorithms.}
  441. Link state algorithms: Computes the least-costpath between source and destination using complete, global knowledge about the network. Distance-vector routing: The calculation of the least-cost path is carried out in an iterative, distributed manner. A node only knows the neighbor to which it should forward a packet in order to reach given destination along the least-cost path, and the cost of that path from itself to the destination.\\
  442.  
  443.  
  444. \textbf{Define and contrast the following terms: subnet, prefix, and BGP route.}\\
  445. \textbf{A:}A subnet is a portion of a larger network; a subnet does not contain a router; its boundaries are defined by the router and host interfaces. A prefix is the network portion of a CDIRized address; it is written in the form a.b.c.d/x ; A prefix covers one or more subnets. When a router advertises a prefix across a BGP session, it includes with the prefix a number of BGP attributes. In BGP jargon, a prefix along with its attributes is a BGP route (or simply a route).\\
  446.  
  447. \textbf{Q:}What is an important difference between implementing the broadcast abstraction via multiple unicasts, and a single network- (router-) supported broadcast?\\
  448. \textbf{A:}N-way unicast has a number of drawbacks, including:\\
  449. Efficiency: multiple copies of the same packet are sent over the same link for
  450. potentially many links; source must generate multiple copies of same packet\\
  451. Addressing: the source must discover the address of all the recipients\\
  452.  
  453. \textbf{Q:}What are the roles played by the \textbf{IGMP protocol and a wide-area multicast} routing protocol?\\
  454.  
  455. \textbf{A:}IGMP is a protocol run only between the host and its first-hop multicast router. IGMP allows a host to specify (to the first-hop multicast router) the multicast group it wants to join. It is then up to the multicast router to work with other multicast routers to ensure that the data for the host-joined multicast group is routed to the appropriate last-hop router and from there to the host.\\
  456.  
  457. \textbf{Q:}Consider sending a 2400-byte datagram into a link that has an MTU of 700 bytes. Suppose the original datagram is stamped with the identification number 422. How many fragments are generated? What are the values in the various fields in the IP datagram(s) generated related to fragmentation?\\
  458. \textbf{A:}$\frac{2400-20}{700-20}$ =3.5, so 4 fragments(20 bytes IP header).
  459. More fragments flag set to 1 on first 3 fragments, 0 on last. Fragment offset field, set to 0,85 , 170, 255.\\
  460.  
  461. \textbf{Q:
  462. What is Framing?} Almost all link-layer protocols encapsulate each network-layer datagram within a link-layer frame before transmission over the link. A frame consists of a data field, in which the network-layer datagram is inserted, and a number of header fields. The structure of the frame is specified by the link-layer protocol.\\
  463. The data link layer, needs to pack bits into frames, so that each frame is distinguishable from another. The Data Link layer prepares a packet for transport across the local media by encapsulating it with a header and a trailer to create a frame.\\
  464. The Data Link layer frame includes:\\
  465. Data - The packet from the Network layer\\
  466. Header - Contains control information, such as addressing, and is located at the beginning of the UPD Trailer - Contains control information added to the end of the UPD \\
  467. \textbf{Q:}
  468. Name three error-detection strategies employed
  469. by link layer.
  470. \textbf{A:}
  471. Parity checks, internet checksum, cyclic redundancy check \\
  472.  
  473. \textbf{Q:}Suppose two nodes start to transmit at the
  474. same time a packet of length L over a broadcast channel of rate R. Denote the propagation delay between the two nodes as d$_{prop}$. Will there be a collision if d$_{prop}$ < L ? Why or why\\
  475. \textbf{A:} There will be a collision in the sense that wile a node is transmitting, it will start to receive a packet from the other node.\\
  476.  
  477. \textbf{Q: In CSMA/CD,}after the fifth collision,what is the probability that a node chooses k= 4? The result k = 4 corresponds to a delay of how many seconds on a 10 Mbps Ethernet?\\
  478. \textbf{A:} After the fifth collision, we chose from \{0, 1, 2, ... , $2^5$ − 1 = 31\} with a
  479. uniform distribution, i.e. $\frac{1}{32}$ . This is a delay of 204.9 $\mu$s. \\
  480. \textbf{Q: }Why does collision occur in CSMA, if all nodes perform carrier sensing before transmission?\\
  481. \textbf{A:}Nodes may not see the other transmission because of propagation delays.\\
  482. \textbf{SECURITY}\\
  483. \textbf{Q:}What is the purpose of the beacon frame in 802.11 (WiFi)\\
  484. \textbf{A:}The beacon frames permit nearby wireless stations to discover and identify the AP\\
  485. \textbf{Q:}As a mobile node gets farther and farther away from a base station, why does the base station increase the transmission power and reduce the transmission rate?\\
  486. \textbf{A:}Increasing the transmission power increases signal to noise ratio, which de- creases the bit error rate. Reducing the transmission rate will also decrease the bit error rate. A lower bit error rate corresponds to a better packet delivery rate \\
  487. \textbf{Q:}Consider the simple model of HTTP streaming. Suppose the server sends data with a constant rate of 2 Mbit/s, the client buffer has a size of 1 MiB (1 MiB = 1024 KiB) and playback begins when the buffer is completely filled. What is the initial buffering delay t$_p$ in seconds (exact to 1 decimal)?
  488. \textbf{A:}Let $x$ be the data rate and $Q$ the buffer size. Then\\ t$_p = \frac{Q}{r} = \frac{1 MiB}{2Mbit/s} = \frac{8 388 608 bit}{2 000 000 bit/s} = $ 4.194 304 s\\
  489. \textbf{Q:}What is the difference between end-to-end delay and packet jitter? What are the causes of packet jitter?\\
  490. \textbf{A:} End-to-end delay is the time it takes a packet to travel across the network from source to destination. Delay jitter is the fluctuation of end-to-end delay from packet to the next packet.\\
  491. \textbf{Q:}From a service perspective,what is an important difference between a symmetric- key system and a public-key system?\\
  492. \textbf{A:}One important difference between symmetric and public key systems is that in symmetric key systems both the sender and receiver must know the same (secret) key. In public key systems, the encryption and decryption keys are distinct. The encryption key is known by the entire world (including the sender), but the decryption key is known only by the receiver.\\
  493. \textbf{Q:}Suppose that an intruder has an encrypted message as well as the decrypted ver- sion of that message. Can the intruder mount a ciphertext-only attack, a known-plaintext attack, or a chosen-plaintext attack?\\
  494. \textbf{A:}In this case, a known plaintext attack is performed. If, somehow, the message encrypted by the sender was chosen by the attacker, then this would be a chosen- plaintext attack.\\
  495. %% var á profi
  496. \textbf{Q:}Can you “decrypt” a hash of a message to get the original message? Explain your answer.\\
  497. \textbf{A:}No. This is because a hash function is a one-way function. That is, given any hash value, the original message cannot be recovered (given h such that h=H(m), one cannot recover m from h).\\
  498. \textbf{Q:}Suppose that Bob receives a PGP message from Alice. How does Bob know for sure that Alice created the message (rather than, say, Trudy)? Does PGP use a MAC for message integrity?\\
  499. \textbf{A:}Alice provides a digital signature, from which Bob can verify that message came from Alice. PGP uses digital signatures, not MACs, for message integrity.\\
  500. \textbf{Q:}Suppose Bob initiates a TCP connection to Trudy who is pretending to be Alice. During the handshake, Trudy sends Bob Alice’s certificate. In what step of the SSL handshake algorithm will Bob discover that he is not communicating with Alice?\\
  501. \textbf{A:}After the client will generate a premaster secret (PMS), it will encrypt it with Alice’s public key, and then send the encrypted PMS to Trudy. Trudy will not be able to decrypt the PMS, since she does not have Alice’s private key. Thus Trudy will not be able to determine the shared authentication key. She may instead guess one by choosing a random key. During the last step of the handshake, she sends to Bob a MAC of all the handshake messages, using the guessed authentication key. When Bob receives the MAC, the MAC test will fail, and Bob will end the TCP connection.\\
  502. \textbf{Q:}A natural question is whether we can use a nonce and public key cryptography to solve the end-point authentication problem in Section 8.4.Consider the following natural protocol: (1) Alice sends the message “I am Alice” to Bob. (2) Bob chooses a nonce, R, and sends it to Alice. (3) Alice uses her private key to encrypt the nonce and sends the resulting value to Bob. (4) Bob applies Alice’s public key to the received message. Thus, Bob computes R and authenticates Alice.
  503. 15.1. (3 points) Diagram this protocol, using the notation for public and private keys em- ployed in the textbook.\\
  504. \textbf{A:}Alice to Bob: I am Alice\\
  505. Bob to Alice: R\\
  506. Alice to Bob: $K^+_A(R)$\\
  507. Bob: $KA-(K^-_A(K^+_A(R))=R$\\
  508. \textbf{Q:}suppose that certificates are not used. Describe how Trudy can become a “woman-in-the-middle” by intercepting Alice’s messages and then pretending to be Alice to Bob.\\
  509. \textbf{A:}Alice to Trudy: I am Alice\\
  510. Trudy to Bob: I am Alice\\
  511. Bob to Trudy: R\\
  512. Trudy to Alice: R
  513. Alice to Trudy: $K^+_A(R)$\\
  514. Trudy to Bob: $K^+_T(R)$\\
  515. Bob: $K^-_T(K^+_T(R))$ so now Bob believes that Trudy is Alice\\
  516. %\includegraphics[width=0.2\textwidth]{output.png}\\
  517. %\includegraphics[width=0.2\textwidth]{switching.png}\\
  518.  
  519. \newpage
  520.  
  521. \textbf{Is it necessary that every autonomous system use the same intra-AS routing algorithm? Why or why not?}\\
  522. No. Each AS has administrative autonomy for routing within an AS.\\
  523.  
  524. \end{multicols}
  525. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement