New User Special Price Expires in

Let's log you in.

Sign in with Facebook


Don't have a StudySoup account? Create one here!


Create a StudySoup account

Be part of our community, it's free to join!

Sign up with Facebook


Create your account
By creating an account you agree to StudySoup's terms and conditions and privacy policy

Already have a StudySoup account? Login here

Operating Systems and System Programming

by: Mr. Hayley Barton

Operating Systems and System Programming COMPSCI 162

Marketplace > University of California - Berkeley > ComputerScienence > COMPSCI 162 > Operating Systems and System Programming
Mr. Hayley Barton

GPA 3.93


Almost Ready


These notes were just uploaded, and will be ready to view shortly.

Purchase these notes here, or revisit this page.

Either way, we'll remind you when they're ready :)

Preview These Notes for FREE

Get a free preview of these Notes, just enter your email below.

Unlock Preview
Unlock Preview

Preview these materials now for free

Why put in your email? Get access to more of this material and other relevant free materials for your school

View Preview

About this Document

Class Notes
25 ?




Popular in Course

Popular in ComputerScienence

This 26 page Class Notes was uploaded by Mr. Hayley Barton on Thursday October 22, 2015. The Class Notes belongs to COMPSCI 162 at University of California - Berkeley taught by Staff in Fall. Since its upload, it has received 13 views. For similar materials see /class/226658/compsci-162-university-of-california-berkeley in ComputerScienence at University of California - Berkeley.


Reviews for Operating Systems and System Programming


Report this Material


What is Karma?


Karma is the currency of StudySoup.

You can buy or earn more Karma at anytime and redeem it for class notes, study guides, flashcards, and more!

Date Created: 10/22/15
i r3817 6525 barkal 6y cadlulta lc 31105 08610 Machine Structures Lecture 24 VM ll r39 I mw 1 W45 quotzquotquotquot In49 i A l i JiVM 20050802 Andy Carle Q c 61CL2MIMIII1 ncm Address Mapping Page Table index into 411 Rights Page Physical table Memory Address Page Table Page Table located in physical memory c 61C L26 VM ll 2 n Carle A page table mapping function There are several different ways all up to the operating system to keep this data around Each process running in the operating system has its own page table Historically 08 changes page tables by changing contents of Page Table Base Register g cs 61C LZMIM II 131 A cm Requirements revisited Remember the motivation for VM Sharing memory with protection Different physical pages can be allocated to different processes sharing A process can only touch pages in its own page table protection Separate address spaces Since programs work only with virtual addresses different programs can have different datacode at the same address Page Table Entry PTE Format cs 61C L2wmm Acme Contains either Physical Page Number or IndIcatIon not In MaIn Memory OS maps to disk if Not Valid V 0 Page Table id Rights PTE If valid also check if have permission to use pa e Access Ri hts AR may be Read nly ReadiWrIiEe Executable g c 61C L2wmu5l ncm PagingNirtual Memory Multiple Processes User A User B Virtual Memory Virtual Memory Physical c 61C L26 VM ll Isl n Carle Comparing the 2 levels of hierarchy Cache Version Virtual Memory vers Block or Line Page Miss Page Fault Block Size 32643 Page Size 4K8KB Placement Fully Associative Direct MapRed Nway Se ssociative Re lacement Least Recently Used L U or Random LRU ite Thru or Back Write Back Notes on Page Table OS must reserve Swap Space on disk for each process To grow a process ask Operating System lf unused pages OS uses them first If not OS swaps some old pages to disk Least Recently Used to pick pages to swap Will add details but Page Table is essence of Virtual Memory VM Problems and Solutions TLB Paged Page Tables Virtual Memory Problem 1 Map ever address 1 indirection via Pa e Tab e in memory per virtua ad ress 1 virtual memory accesses 2 physical memory accesses SLOW Observation since locali in pa es of data there must be locali in vir ual address translations of those pages Since small is fast why not use a small cache of virtual to ph sical address translations to make ranslation fast For historical reasons cache is called a Translation Lookaside Buffer or TLB Translation LookAside Buffers TLBs TLBs usually small typically 32 256 entries Like any other cache the TLB can be direct mapped set associative orfully associative miss Processor n TLB miss get page table entry from main memory Typical TLB Format Virtual I 39 1 Re Valid Access Address Address Rights TLBjust a cache on the page table mappings TLB access time comparable to cache much less than main memory access time Dirty since use write back need to know whether or not to write page to disk when replace M se to help calculate LR on replacement Cleared by OS periodically then checked to asee if page was reierence What if not in TLB What if the data is on disk Option 1 Hardware checks age table aria loads new Page Table ntry into Ogtion 2 Hardware tra O to decide what to MIPS follows Option 2 Hardware knows nothing about page table ps to OS up to do We load the age off the disk into a free block 0 memory usi ng a DMA iDIrect Memory Access very fast ransfer Meantime we switch to some other process waiting to be ru When the DMA is complete we get an interrupt and update the process39s page tab So when we switch back to desired data will be in m the task the 0W What ifwe don39t have enough memory We choose some othe Question r page belonain to a rogram and transfer it onto t e Isk I It Is dlrty If clean disk copy is uptodate just overwrite that data in memory We chose the page to evict based on replacement policy eg L And update that program39s page table to reflect the fact that its memory moved somewhere else If continuously swap between disk and memory called Thrashing Why is the TLB so small yet so effec ive Because each entry corresponds to pagesize of addresses Why does the TLB typically have high associativity What i the associatiVIty of VAPA mappings Becaus e the miss penalty dominates the AMAT for VM Virtual Memory Problem 1 Recap Slow High associativity lower miss rates VPNPPN mappings are fully associative Every memory access requires 1 access to PT to get VPNgtPPN translation 1 access to MEM to get data at PA Solution Cache the Page Table Make common case fast PT cache called quotTLBquot block sizequot is just 1 VPNgtPN mapping TLB associativity Virtual Memory Problem 2 Page Table too big 4GB Virtual Memory 1 KB page gt 4 million Page Table Entri es gt 16 MB just for Page Table for 1 process 8 processes gt 256 MB for Page Tables Spatial Locality to the rescue Each page is 4 KB lots of nearby references But large page size wastes resources Pa es in program s workin ex ibit g set will temporal and spatIa localIty E So Solutions Page the Page Table itself Works but must be careful with never ending page faults Pin some PT pages to memory 2level page table Solutions tradeoff inmemory PT size for slower TLB miss Make TLB large enough highly associative so rarely miss on address translation CS 162 will go over more options and in greater depth Page Table Shrink Single Page Table Page Number w 20 bits 12 bits Multilevel Page Table GE 10 bits 10 bits 12 bits Only have second level page table for valid entries of super level page table Book Exercises explore exact space 39 s a savmg Administrivia Proj 3 Due Friday Proj 4 Out Soon HW 8 Probably but it will be short 2level Page Table Vi iiu 2nd Level Super Page Tables Three quot 39 ofVirtual Memory 1 Translation Program can be given consistent view of memory even though p ysical memory is scrambled illusion of contiguous memory All programs starting at same set address Illusion of infinite memory 232 or 264 bytes Makes multiple processes reasonable Only the most important part of program Working Set must be in physical memory Contiguous structures like stacks use only as much physical memory as necessary yet still grow later Cache Proc and VM in IF A Fine Slide Fetch P6s J EXE PC Pc4 tlb hit quotI V VPquotPPN M P Cache hit 7Load ihto IR Trap os Mem hit pt hitwUpdate TLB v quot v xxx 7 Free merrr Restart v Cache full V n quot Pick victim Plck victim 39 39 Write policy victim to dlsk wb Wk Load new page WE 39f dmy Update PT Update TLB l a Re 5 Restart Evict victim Cache Proc and VM in IF A Fine Slide Fetch PC EXE PC PC4 tlb hit quot V VPN39gtPPN Map Cache hit v Load into IR n Trig S Mem hit u7Update TLB pt mt v xxx Free mem Restart v Cache full v quot Pick victim Pick qctlm Victim to disk war39te Icy Where Is the wt L d new page WE 39f My page fault Update pr Evict victim Update TLB Loa block Restart 1 Restart ampVM Review 4 Qs for any Mem Hierarchy Q1 Where can a block be placed in the upper level Block placement Q2 How is a block found if it is in the upper level Block Identi cation Q3 Which block should be replaced on a miss Block replacement Q4 What happens on a write Write strategy Q1 Where block laced in u er level Block 12 placed in 8 block cache Fully associative direct mapped 2way set assomative SA Mapping Block Number Mod Number Sets Black 233557 9 32 nizataei ai nizataei Fully assucialive Sgt 121 Szet 5321 DireclmaPPEd mmmzca39mu bluck can gu Selassucialiv anvw eve untv inlu black a black 1 2 can gm 12 mud a WWW in set u aimmamc address 12 m a W 1111111111222222222233 quot EH23656785U123656785U123656785U1 Q2 How is a block found in upper level Set Select Data Select Direct indexing using index and block et tag compares or combination lncreasin associativity shrinks index expands ag Q3 Which block replaced on a miss Easy for Direct Mapped Set Associative or Fully Associative Random LRU Least Recently Used Miss Rates Associativity2way 4way 8way Size LRU Ran LRU Ran LRU Ran 16 KB 52 57 47 53 44 50 64 KB 19 20 15 17 14 15 KB 115 117 113 113 112 112 Q4 What to do on a write hit Writeth rough update the word in cache block and corresponding word in memory Writeback update word in cache block allow memory word to be stale gt add dirty bit to each line indicating that memory be updated when block is replaced gt OS flushes cache before No ll Performance tradeoffs WT read misses cannot result in writes WB no writes of repeated writes Lecture 36 Mike Clancy guest lecturer Topics Review of virtual memory and address translation with more details El Novemberll 2007 cs 61C lect 36 1 Review of Monday MIPS physical memory is managed by the operating system in units called pages There are typically pages from several different processes in memory at once Any particular program thinks that it s in memory all at once and that its text segment is contiguous and so is its data segment The program is working with virtual addresses Virtual addresses are translated by the operating system to physical addresses El Novemberll 2007 cs 61C lect 36 2 Page layout in memory Physical Memory DRAM El Novemberll 2007 cs 61C lect 36 Address translation 08 uses part of the virtual address the virtual page number VPN to access a page table It finds the physical page numberPPN there and constructs a physical address III Novemberll 2007 cs 61C lect 36 Address translation PampH Figure 721 Ei Ella Nuvemherzl mm cs 610 iect e Each element of the page table contains o The physical page number Other stuff Is the page in physical memory Has it been changed Has it been accessed recently Access permission Ei Nuvemherzl mm cs 610 iect e Page table example El Novemberll 2007 cs 61C lect 36 Pages may be either in physical memory or swapped out to disk Novemberll 2007 cs 61C lect 36 Problems Space How big is a page table for a system with virtual addresses of 40 bits and pages of size 16 K Time How many memory accesses per load El EIEI Nuvembazmum cs Eiciect as a Space solutions TWOIeve page i WWW i mermaid Wm table see hwll mimetic 39 Access page table via virtual address mm mm a aecm iwei mum 39 Both solutions add more time El Nuvembazmum cs sic heat as in Time solution Use a cache Translationlookaside buffer TLB caches virtual page numberphysical page number pairs El Novemberll 2007 cs 61C lect 36 11 Compare TLB with 16KB cache TLB cache size 32 wds 4096 wds block size 1 word 1 word miss rate 12 organization fully assoc direct mapped Why why so small Novemberll 2007 cs 61C lect 36 12 TLB use PampH Figure 724 Why cache physical addresses rather than virtual addresses El Novemberll 2007 cs 61C lect 36 13 Another question Some areas of memory are not mapped that is addresses into these areas are treated as physical addresses Why would we not want everything to be mapped El Novemberll 2007 cs 61C lect 36 14 Event probability Which of the following is least likely a TLB miss cache hit b TLB miss cache miss c TLB hit cache miss Which is most likely El Novemberll 2007 cs 61C lect 36 15 Comparing the two levels of hierarchy Cache version Virtual Memory version Block or Line Egg Miss Page Fault Miss handled in HW Page Fault handled in SW Block Size 32648 Page Size 4K 8KB Placement Fully Associative Direct Mapped Nway Set Associative Replacement Least Recently Used LRU or Random LRU Write Thru or Back Write Back III Novemberll 2007 cs 61C lect 36 16 Starting a program Read executable file and determine how many pages are needed Create page table Initialize sp and gp in a C program Load one page into memory and in user mode jump to its start address November212007 CS 61C lect 36 El E Getting more storage On the stack more pages are provided by the OS on demand On the heap a system call provides more pages KampR s sbrk makes this call November212007 CS 61C lect 36 limits writable storage El November 21 2007 Potential errors detected after TLB exception Check 1 is VPN outside the program s Segmentation fault if so Check 2 is page protected Segmentation fault if so and not in kernel mode Check 3 if a store operation is page Segmentation fault if not eg constant string CS 61C lect 36 19 El November 21 2007 Contrast seg fault with bus error Illegal address gt bus error Exception is generated by the hardware Legal address that you aren t allowed to use gt segmentation fault Error is generated by the OS CS 61C lect 36 20 Details of a page fault see CS 162 for more info A notrecentlyused policy says which page can be replaced Every so often the OS clears all the have I been used recently bits A page with that bit off is a candidate for replacement Readonly or notyetwritten pages need not be written to disk El Novemberll 2007 cs 61C lect 36 21 Happy Thanksgiving III Novemberll 2007 cs 61C lect 36 22 Computer Science 162 Lecture Notes Gautam Wilkins Armen Khodaverdian April 13 2009 1 Announcements Midterm 2 will be in 306 Soda Hall on Wednesday 41509 at 700 PMi There will be a regular class that day as well but the material covered will not be on Midterm 2 but will be on Midterm 3 The midterm is closed book closed notes 2 Lecture Material Networks Communication Protocols and Distributed Systems 21 History This subject came about in the 1960s where users wanted to be able to send data between machines without physically transferring storage media Today there a very large number of small machines that need to share information There are getting to be more and more connected areas around the world We want to be able to tie all areas together with networks but in order to do so we need protocolsi Protocols can be thought of as similar to languages everyone speaks at least one language and we need a common language in order to properly communicatei The only thing that stops the world from looking like a single integrated computer system is performance The speed of light is a fundamental limita tion on the speed of data transfer and thus when sending messages distance mattersi Over long distances there is a performance lag though this lag has been getting progressively shorter due to such things as the introduction of cables with Gigabit per second transfer rates and switches and circuits that operate on nanosecond timeframesi Thus even when messages such as email are sent through dozens of routers and numerous cables it still seems virtually instantaneousi One of the rst networks was the Advanced Research Projects Agency Net work ARPANET which was developed by ARPA a United States Government Agency It was developed in the late 1960s and connected together a number of time sharing systems belonging to Defense Department contractors in order to facilitate communication It was designed with resiliency and defense consider ations in mind and thus contained a good amount of redundancy There were two basic pieces of hardware routers and terminals There were a fairly limited number of defense contractors with access to this network and others found it desirable which prompted the construction of other similar systems The fundamental protocols of ARPANET are very similar to the protocols employed by the current internet as we know it which is rather impressive given how long ago ARPANET was developed The following are some other early networks worthy of mention 0 USNET Required explicit routing for all transersi Cheap and easy to user 0 CSNET A network supported by the National Science Foundation It was designed to be a clone of ARPANET for university user o BITNET A network that connected IBM mainframes It was employed by a number of physics laboratories o VNET IBM An internal network used by IBM It was designed with security as a principal concern 0 DECNET A network and series of protocols created by Digital Equipment Corporation DEC and used internally as well as sold as a product In the 1980s a large number of commercial networks started up All of these separate networks were eventually linked and thus called the 77internetwork77 or internet 211 Questions I Did IBM s personal network have better security than the Defense De partment s network Yes7 it did You shouldnlt necessarily assume that government systems are always more secure than privately operated ones Government systems have and continue to be exploited 2 2 Network Topologies There are essentially two types of networks fully connected not really feasible for large networks or partially connected networks where messages are sent through nodes The simplest kinds of network topologies are the ring and the star The star focuses on connecting everything to a central node7 while the ring creates a loop around all the nodes Such networks often rely on multiaccess busbroadcast7 such as the traditional Ethernet7 which was just a single cable with links for each user 2 3 Network Performance When we consider network performance7 there are many parameters to consider 0 Latency the time to get 1 bit from end to end determined by distance and speed of transfer medium 0 Setup Latency time to transfer rst bit from end to end 0 Transmission Latency time to transfer subsequent bits from end to end almost always shorter than setup latency Bandwidth how many bitssec are transferred from end to end If we wanted to transfer a very large amount of data it may make more sense to package hard drives and ship them to their destination 0 Cost how much will it cost to transfer the data 1Annecdote Livermore laboratory has high security and requires an ID badge in order to enter A guard physically examines the ID before allowing the owner in About 20 years ago someone pasted a picture of an ape over his ID badge and went in and out for a week without anyone noticing When he nally reported this lapse to security he was red Star Network Ring Network Figure 1 Topologies of Ring and Star Networks 24 Network Protocols It is Very easy to invent a network but everyone must agree on its protocols in order to ensure reliable communication For example if you went to Irkutsk in Siberia the odds of people speaking English are probably low If you cannot s eak Russian then you will not be able to communicate with anyone When creating networks a lot of time is spent trying to come to an agreement on protocols Recommended reading is section 156 in the textbook to see speci c network protoco rotocols all haVe layers The lowest layer is electrical and handles the physical transmission of data The up er layers consist of software Each layer has an interface to the layers directly aboVe and below it and in end to end communication each layer of the sender talks to the corresponding layer of the receiVer ie electrical layer talks to electrical layer application layer talks to application la er ISO Protocols haVe the following layers listed in order from lowest to highest I Physical Lowest layer Handles Voltages delay current and error correc7 tion at the byte leVel I Data Link Get packets between two connected components Includes low leVel error correction I Network Get packets from source to destination by routing through other machines I Transport Low leVel access to the network Keeps packets in order con trols transmission rate generates physical address takes care of retrans mission of lost packets 0 Session Process to process protocols 0 Presentation Handles differences between sites and formats 0 Application User interface to network The physical data link network link and transport layers are all well de ned but the session presentation and application layers are more 77fuzzy77 They are not strictly de ned the way the lower levels are A lot of original computer science technology was developed in the US but networking has been heavily done in Europe With a lot of borders different currencies etc European nations have a great deal of experience in setting standards and protocols 241 Questions 1 For the transport layer aren t there speci c protocols like UDP Yes The transport layer is an abstraction and protocols like TCPIP and UDP are speci c instances of the transport layer 2 5 Network Types There are two main types of networks Local Area Networks LAN and Wide Area Networks WAN LAN systems are in the same geographic area whereas WAN systems are geographically distributed WANs are interconnected made up of LANs that are broadcast networks every node communicates directly with every other e simplest scheme for broadcast networks is pure broadcast where all messages are sent to every node in the network much like radio broadcasts This is the same as the original version of Ethernet where 77ether77 refers to the shared communication medium between the nodes generally a cable An example of such a network is ALOHAnet a satellite based network that was implemented in Hawaii The protocol for ALOHA is relatively simple Each device sends a transmission to the satellite which receives the message and then retransmits it to all other devices The sending device listens for its own message and if it comes back properly the it has been successfully transmitted If the message comes back garbled that means another device was transmitting a message at the same time this is known as a collision If a collision occurred then the sending device must retransmit its message This system however is inherently unstable As more senders send more messages the probability of collisions increases As collisions occur there becomes a backlog of messages that must be resent which further increases the number of messages being sent The end result is that for large levels of traf c nothing can be transmitted This problem can be easily analyzed and the maximum utilization of such a system is around 18 of the theoretical bandwidth quotctzmcoII l Network Traffic Figure 2 Plot demonstrating failure of AlohaNet under high traf c A better protocol is SlottedALOHA Since any overlap between transmitted messages results in both being garbled SlottedALOHA makes it so that two messages either completely overlap or do not overlap at all To ensure this Slotr tedALOHA employs a clock Now instead of simply transmitting at any time transmissions are only allowed between clock ticks So a message transmission starts on a clock tick and must end before the next clock tick Thus if two mes sages collide they will both have been sent in the same slot A mathematical analysis on the SlottedALOHA shows that the maximum attainable bandwidth is 36 of the theoretical maximum 251 Questions 1 Do all senders use the same clock Yes the simplest solution is to have the satellite broadcast the clock signal to all the senders Do we waste time at the edges of the clock Do all messages have to be the same legnth The messages are not strictly required to ll the entire slot but each transmission can take no longer to transmit than the interval between clock ticks The simplest way to deal with long messages is to break them up into packets and send them one at a time 3 How do senders know if the satelkte is being overloaded You can track load y checking to see if your message was retransmitted properly If it comes back garbled then a collision occurred If a large percentage of your transmissions collide then the satellite is probably overloaded 26 Ethernet If the communication medium does not involve satellite transmission then bet ter methods can be used In the original Ethernet protocol all users shared a single cable maximum length of 4000 ft for collision detection considerations Users connect to the cable through a pin stuck in the center connecter Figure 3 Ethernet cable with multiple connecting nodes Ethernet employs Carrier Sense where each sender monitors the channel before sending a transmission If there is another message being ransmitted then the sender waits before sending its message Carrier Sense alone however is not enough to ensure that collisions will not happen If two senders simulta7 neously send a message then a collision will occur even with Carrier Sense deal with this Ethernet employs Carrier Sense Multiple Access with Collision Detection CSMACD With Collision Detection a sender also monitors the el while sending a message If it detects another message being transmi ted at the same time it immediately stops transmitting its message to decrease wasted bandwidth and then waits a random amount of time before retransmitr ting As the number of collisions increases the amount of time a sender waits before retransmitting increases to help relieve network congestion Why would you want to wait for a random amount of time instead of a for a xed amount The original Ethernet protocol has some problems namely I Reliability A user can either maliciously or unintentionally jam a network I Fairness A user that constantly sends transmissions will get an unfair share of bandwidth I Bandwidth Original cables limited transmission rate to 10 Mbps I Security Everyone on the network can see all transmissions Current Ethernet technology uses switches and hubs to help control collision and deal with signal degradation Also there are currently cables that transmit at rates of 100 Mbps and leps2 Wireless Ethernet works with protocols that are similar to Wired Ethernet though with some modi cations 2 7 Ring Networks As mentioned earlier Ring Networks are a type of broadcast network All the nodes are connected in a ring and all messages are passed around the ring in a circular fashion To avoid collisions this method relies on a token that is passed around to each node on the ring When a node wishes to send a message it waits until it acquires the token then keeps it and transmits its message When the message is retransmitted to the original sender it has passed to all the other nodes as well so the sender releases the token and passes it on to the next node This type of broadcast network is a very poor one in practice It creates two main central points of failure First is that if a single node or cable dies then the whole network goes down as well The second is the token itself If the token vanishes or is corrupted then the whole network fails Also if a node does not ever pass on the token then no other node in the network can transmit data The dilemma becomes even worse if the token is accidentally cloned resulting in two nodes transmitting at the same time and causing collisions In the past IBM used Ring Networks for a number of years but have long since discontinued their use 28 Linking Two Machines There are three methods by which we can establish a link between two separate machines 1 Circuit Switching This method is similar to the way telephone calls are handled A physical circuit is created between the sender and receiver on which only their data is allowed to travel E0 Packet Switching The message is broken up into packets sent piece by piece and reassembled at the end Packet Switching does not have a set route for all the packets to take so different packets can travel on different routes Using Packet Switching creates avirtual circuit as in VolP where the sending and receiving machines have the illusion of a circuit connecting them 9 Message Switching Message Switching creates a virtual circuit between two nodes for long enough to send a complete message and then drops the circuit 2As a note regarding higher cable bandwidth few PC network cards can consistently push data at a rate of 1 Gbps so often cables with such a transfer rate are not particularly more useful than their 100 Mbps counterparts When using Packet Switching the packets must be forwarded from machine to machine in order to get from one sender to another and often times must also be sent between networks We call machines that transfer packets between networks gateways 29 Names Addresses and Routes The name is a symbolic name for something such as 77Google77 or 77Amazon77 The address refers to the location of the object in question usually consisting of a network a number of a site on the network and t e ID of a 0st route is the actual path through networks and machines that a packet takes in order to reach its destination Sometimes the sender may have to specify the route but this is inconve nient for the user as well as potentially slowl In practice routing is done by machines on the internet3 Essentially every machine knows how to reach the nearest gateway and the gateway knows how to reach other gateways in order to transmit a packet Domain Name System DNS Servers manage the map pings from the name of a page iiei 77httpwwwlgooglelcom to an IP address which routers then use to determine the path the packet should take to reach its destination If the name or IP address is not recognized then the packet is dropped Networks are set up so that multiple routes are possible when trying to reach a destination This means that if a single network goes down packets that would normally be routed through it can instead take other routes to reach their destination 210 Communication Problems There are numerous potential problems that can arise while transmitting packets over a network Packets can get lost or dropped either due to transmission errors or corruption routers can become full called network congestion which results in packets being dropped packets might be sent to a machine that is not operational and so on Packets can arrive out of order and datagram protocols attempt to deliver individual packets but make no guarantees regarding whether the packets will actually arrive or whether the packets will arrive in the order that they were sent This can be a problem for some applications since they often want assur ances regarding the delivery and order of arrival of the packets they send The solution to this problem involves the transport layer protocol First it estab lishes a connection between the sending and receiving machines using what is known as the Three Way Handshake The sending machine rst transmits a request for a connection to the receiving machine The receiving machine then sends an acknowledgement ack to the sending machine The sending machine 3The mechanisms of this will be discussed in later lectures then sends an ack back to the sending machine When the receiving machine receives the ack7 the connection has been established When the receiver gets any subsequent packets from the sender it always sends an ack back7 and the sender retransmits any packets that it does not get an ack for This ensures that all packets Will be delivered to the sender


Buy Material

Are you sure you want to buy this material for

25 Karma

Buy Material

BOOM! Enjoy Your Free Notes!

We've added these Notes to your profile, click here to view them now.


You're already Subscribed!

Looks like you've already subscribed to StudySoup, you won't need to purchase another subscription to get this material. To access this material simply click 'View Full Document'

Why people love StudySoup

Jim McGreen Ohio University

"Knowing I can count on the Elite Notetaker in my class allows me to focus on what the professor is saying instead of just scribbling notes the whole time and falling behind."

Anthony Lee UC Santa Barbara

"I bought an awesome study guide, which helped me get an A in my Math 34B class this quarter!"

Bentley McCaw University of Florida

"I was shooting for a perfect 4.0 GPA this semester. Having StudySoup as a study aid was critical to helping me achieve my goal...and I nailed it!"


"Their 'Elite Notetakers' are making over $1,200/month in sales by creating high quality content that helps their classmates in a time of need."

Become an Elite Notetaker and start selling your notes online!

Refund Policy


All subscriptions to StudySoup are paid in full at the time of subscribing. To change your credit card information or to cancel your subscription, go to "Edit Settings". All credit card information will be available there. If you should decide to cancel your subscription, it will continue to be valid until the next payment period, as all payments for the current period were made in advance. For special circumstances, please email


StudySoup has more than 1 million course-specific study resources to help students study smarter. If you’re having trouble finding what you’re looking for, our customer support team can help you find what you need! Feel free to contact them here:

Recurring Subscriptions: If you have canceled your recurring subscription on the day of renewal and have not downloaded any documents, you may request a refund by submitting an email to

Satisfaction Guarantee: If you’re not satisfied with your subscription, you can contact us for further help. Contact must be made within 3 business days of your subscription purchase and your refund request will be subject for review.

Please Note: Refunds can never be provided more than 30 days after the initial purchase date regardless of your activity on the site.