operating systems chapter 6+7

14
CHAPTER 6 Q1. Define the responsibility of Transport Layer. Responsible for delivering data across networks with the desired reliability or quality Q2. Describe the following: a. Services Provided by transport layer Transport layer adds reliability to the network layer • Offers connectionless (e.g., UDP) and connectionoriented (e.g, TCP) service to applications Transport layer sends segments in packets (in frames b. All Transport Service Primitives Primitives that applications might call to transport data for a simple connection-oriented service: • Client calls CONNECT, SEND, RECEIVE, DISCONNECT • Server calls LISTEN, RECEIVE, SEND, DISCONNECT

Upload: mali-trolejbus

Post on 23-Nov-2015

20 views

Category:

Documents


2 download

DESCRIPTION

Solved problem sheets for operating systems course chapter 6 and 7.

TRANSCRIPT

CHAPTER 6Q1. Define the responsibility of Transport Layer.Responsible for delivering dataacross networks with the desiredreliability or qualityQ2. Describe the following:a. Services Provided by transport layerTransport layer adds reliability to the network layer Offers connectionless (e.g., UDP) and connectionoriented(e.g, TCP) service to applications

Transport layer sends segments in packets (in frames

b. All Transport Service PrimitivesPrimitives that applications might call to transport datafor a simple connection-oriented service: Client calls CONNECT, SEND, RECEIVE, DISCONNECT Server calls LISTEN, RECEIVE, SEND, DISCONNECT

State diagram for a simple connection-oriented serviceSolid lines (right) showclient state sequenceDashed lines (left) showserver state sequenceTransitions in italics aredue to segment arrivals.

c. Three-way handshake for establishing connectionThree-way handshake usedfor initial packet Since no state fromprevious connection Both hosts contributefresh seq. numbers CR = Connect Request

Three-way handshakeprotects against odd cases:a) Duplicate CR. SpuriousACK does not connect

b) Duplicate CR and DATA.Same plus DATA will berejected (wrong ACK).

d. main problem that effect the network performanceUnexpected loads often interact with protocols to causeperformance problems Need to find the situations and improve the protocolsExamples: Broadcast storm: one broadcast triggers another Synchronization: a building of computers all contactthe DHCP server together after a power failure Tiny packets: some situations can cause TCP tosend many small packets instead of few large onese. DTN ArchitectureMessages called bundles are stored at DTN nodeswhile waiting for an intermittent link to become a contact Bundles might wait hours, not milliseconds in routers May be no working end-to-end path at any timeExample DTN connecting a satellite to a collection pointTheremay be no working path sometimes (satellite has no contact, ground station backhaulbroken) or the path might not exist for long enough to send a but satellite software wouldstill like to send images without worrying about these issues even if the network storesthem. Storing bundles at ground stations also decouples the satellite link from theground backhaul. If the wireless is faster then images may be stored in the groundstation.Example DTN connecting a satellite to a collection point

Q3. Briefly explain:a. All Connection Release techniquesKey problem is to ensurereliability while releasingAsymmetric release (whenone side breaks connection)is abrupt and may lose data

Symmetric release (both sides agree to release) cantbe handled solely by the transport layer Two-army problem shows pitfall of agreement

Normal release sequence,initiated by transport user onHost 1 DR=Disconnect Request Both DRs are ACKed bythe other side

Error cases are handled with timer and retransmission

b. Packed Crash RecoveryApplication needs to help recovering from a crash Transport can fail since A(ck) / W(rite) not atomic

c. TCP Uses several mechanisms that work together for congestion control

Q4. B has a fixed buffer of 4 segments. A gets to send up to message ack+buf. Messages gointo Bs buffer.a. Draw occupied buffer space. At unrelated times Bs application reads data fromBs buffer and frees up space for more data to arrive.

b. When does Bs application receive data from the buffer? Between times 5&6,10&11, 11&12, and 15&16.Q5. Explain why does the maximum packet lifetime, T, have to be large enough to ensurethat not only the packet but also its acknowledgements have vanished?If we wait a time T secs after apacket has been sent, we can be sure that all traces of it are now gone and that neitherit nor its acknowledgements will suddenly appear out of the blue to complicatematters.With packet lifetimes bounded, it is possible to devise a practical and foolproofway to reject delayed duplicate segments.If a machine loses its memory or crashes, it will not know which the next identifier to assign to a new connection is, and which connection identifiers were already used. Consequently, we have to wait a time T after a packet or acknowledgement has been sent, to make sure an old duplicate appears as legitimate one to confuse matters.

Q6. briefly explain and draw the following:a. Max-min fairness gives equal shares of bottleneck

Note that fairness is more complicated than giving all flows the same bandwidth, e.g.,1/3 units. B, C, and D share a bottleneck so they each get 1/3 of it. But A does not havethis bottleneck so giving it 1/3 units only wastes some bandwidth -- it can have 2/3 unitswithout slowing anyone else down. This is max-min fair, which maximizes the minimumbandwidth flows get, then lets flows go ahead when they are able to use excessbandwidth. b. Changing bandwidth allocation over timeWe want bandwidth levels to converge quickly whentraffic patterns change

c. UDPUDP (User Datagram Protocol) is a shim over IP Header has ports (TSAPs), length and checksum.

d. TCP Sliding WindowTCP adds flow controlto the sliding windowas before ACK + WIN is thesenders limit

Need to add special cases to avoid unwanted behavior E.g., silly window syndrome [below]

e. Bundle Protocol design formatFeatures of the bundle message format: Dest./source add high-level addresses (not port/IP) Custody transfer shifts delivery responsibility Dictionary provides compression for efficiency

Q7. Give the full name for the following:a. UDP User Datagram Protocolb. TSAP Transport Services Access Pointc. ACK Acknowledgementd. RPC Remote procedure calle. RTP Real-time Transport Protocolf. TCP Transmission Control Protocol

g. cwnd congestion windowh. RTT round-trip timei. DTN Delay Tolerant Networks Q8. How the user's packet lost in the network?Wireless links lose packets due to transmission errorsQ9. What are the rules of thumb for fast host software? Host speed more important than network speed Reduce packet count to reduce overhead Minimize data touching Minimize context switches Avoiding congestion is better than recovering from it Avoid timeoutsQ10. Why for fast and better performance needs compression for packet header?Overhead can be very large for small packets 40 bytes of header for RTP/UDP/IP VoIP packet Problematic for slow links, especially wirelessHeader compression mitigates this problem Runs between Link and Network layer Omits fields that dont change or change predictably 40 byte TCP/IP header 3 bytes of information Gives simple high-layer headers and efficient linksQ11. What is the purpose of DTNs?store messages inside the network until they can be deliveredQ12. Why Convergence layers used in/with the bundle protocol?We want to define just one Bundle protocol to run overTCP or other transport layers (SCTP, etc.). The transport protocols are not going to haveexactly the same interfaces, so they will not fit exactly with the bundle protocol.Convergence layers are the glue that join the interfaces together.Q1. Give the full title for the following:a. DNS Domain Name Systemb. IP Internet Protocolc. STMP Simple MailTransfer Protocol)d. MIME Multipurpose Internet Mail Extensione. HTTP HyperText Transfer Protocolf. URL Uniform Resource Locatorsg. DCT Discrete Cosine Transformationh. JPEG Joint Photographic Experts Groupi. SIP Session Initiation Protocol)j. CDN Content Delivery Networkk. P2P Peer to peerl. DHT Distributed Hash Tables

Q2. What is the purpose for the DNS?The DNS resolves high-level human readablenames for computers to low-level IP addressesQ3. How user/computer find an IP?Finding the IP address for a given hostname is calledresolution and is done with the DNS protocol.Resolution: Computer requests local name server to resolve Local name server asks the root name server Root returns the name server for a lower zone Continue down zones until name server can answerDNS protocol: Runs on UDP port 53, retransmits lost messages Caches name server answers for better performance

Q4. Briefly explain this URL protocol: http://www.phdcomics.com/comics.php

Q5. Write all necessary Steps for a client (browser) takes to follow a hyperlink.Steps a client (browser) takes to follow a hyperlink: Determine the protocol (HTTP) Ask DNS for the IP address of server Make a TCP connection to server Send request for the page; server sends it back Fetch other URLs as needed to display the page Close idle TCP connectionsQ6. Write all necessary Steps for a server takes to serve pages.Steps a server takes to serve pages: Accept a TCP connection from client Get page request and map it to a resource (e.g., file name) Get the resource (e.g., file from disk) Send contents of the resource to the client. Release idle TCP connections Q7. What are the differences between the following:a. Static and dynamic web pagesStatic Web pages are simply files Have the same contents for each viewingCan be visually rich and interactive nonetheless: HTML that mixes text and images Forms that gather user input Style sheets that tailor presentation Vector graphics, videos, and more (over) . . .Dynamic pages are generated by programs runningat the server (with a database) and the client E.g., PHP at server, JavaScript at client Pages vary each time like using an applicationWeb page that getsform input and callsa server programPHP server programPHP callsthat creates acustom Web pageb. server and client programs

Q8. Briefly explain the HTTP.HTTP (HyperText Transfer Protocol) is a requestresponseprotocol that runs on top of TCP Fetches pages from server to client Server usually runs on port 80 Headers are given in readable ASCII Content is described with MIME types Protocol has support for pipelining requests Protocol has support for cachingQ9. Gives all steps are required by JPEG lossy compression sequence to compress one stillImage

Q10. How do peers (P2P) find each other? Peers find each other via Tracker in torrent file