cop 5611 operating systems spring 2010
DESCRIPTION
COP 5611 Operating Systems Spring 2010. Dan C. Marinescu Office: HEC 439 B Office hours: M-Wd 2:00-3:00 PM. Lecture 9. Reading Assignment: Chapter 7 from the online textbook HW1 due today. Remember: A progress report for the project is due on every Monday till week 12. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/1.jpg)
COP 5611 Operating Systems Spring 2010
Dan C. Marinescu
Office: HEC 439 B
Office hours: M-Wd 2:00-3:00 PM
![Page 2: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/2.jpg)
222222
Lecture 9
Reading Assignment: Chapter 7 from the online textbook HW1 due today. Remember: A progress report for the project is due on every
Monday till week 12. Last time: Thread coordination and scheduling
Multi-level memories I/O bottleneck
Today: Network properties Layering Data link layer
Next time Network layer
![Page 3: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/3.jpg)
3
Properties of Networks
Physical limitations: Speed of light finite communication latency Hostile environments Limited channel capacity limited bandwidth
Channels are shared - multiplexed Why:
Support any-to-any communication Share costs
How Isochronous multiplexing – scheduled access
TDM FDM
Asynchronous multiplexing
![Page 4: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/4.jpg)
4
BostonSwitch
Los AngelesSwitch
multiplexed link
shared switches
B1
B2
B3
L1
L2
L3
L4
Communication channels are multiplexed
![Page 5: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/5.jpg)
5
Time5,624 bit times
8-bit frame 8-bit frame 8-bit frame
Data flow on an isochronous link
![Page 6: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/6.jpg)
6
Personal Computer service
multiplexedlink
data crosses thislink in bursts andcan tolerate variable delay
A
B
C
D
A data communication network
![Page 7: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/7.jpg)
7
Time
Guidance 4000 bits 750 bits
B D
information
frame
Asynchronously multiplexed link
![Page 8: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/8.jpg)
8
Communication
Continuous versus bursty The old phone network versus data networks Human versus computer communication
Connection-oriented versus connectionless communication Packet-forwarding networks
Routing problem Delays
![Page 9: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/9.jpg)
9
(gradual)1 variable delay2 discards data3 rate adaptation
(hard-edged) either accepts or blocks call
good match
wastes capacity
good match
variable latency upsets
application
Continuous stream
(e.g., interactive voice)
Bursts of data (most
computer-to-computer data)
Response to load
variations
isochronous (e.g., telephone
network)
asynchronous (e.g., Internet)
NetworkType
Application characteristics
![Page 10: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/10.jpg)
10
PacketSwitch Packet
Switch
PacketSwitch
PacketSwitch
Service at network
Workstation 1
2 3at networkattachment
attachmentpoint B
A
B
point A
packet
B
Packet forwarding (store and forward) networks
![Page 11: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/11.jpg)
11
Problems in packet forwarding networks
Delay Propagation delay Transmission delay Processing delay Queuing delay
Resources are finite and a worst case design is not feasible heavy tail distributions of resource needs
Buffer overflow and discarded packets Adaptive rate modulated by information regarding network congestion Timers and packet retransmission Duplicate packets
![Page 12: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/12.jpg)
12
average
Utilization, r0 100%
1
11 –------------
tolerable delay
rmax
queuingdelay
maximum
Queuing delays versus utilization.
![Page 13: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/13.jpg)
13
A B
time
X overloaded
resend request,
send request,
receive response,
send request,
timer expires,
set new timer
receive response,
X
X
set timer
reset timer
set timer
reset timer
forwarderdiscardsrequestpacket.
request 1
response 1
request 2
request 2’
response 2’
Recovery of lost packets
![Page 14: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/14.jpg)
14
A B
X overloaded forwarder
send request,
duplicate arrives at BB sends response 3’
timer expires,resend request,
Xreceive response,
set new timer
set timer
reset timer
discards response 3
request 3
request 3’
response 3’
Duplicate requests
![Page 15: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/15.jpg)
15
A B
packet containing responsetimer expires,resend
send request,
duplicate arrives at BB sends response 4’
receive
response
receiveresponse,
reset timer
X
duplicate
gets delayed
set timerrequest 4
response 4
request 4’
response 4’
Delays and recovery lead to duplicate response
![Page 16: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/16.jpg)
16
Networks encounter a vast range ofData ratesPropagation, transmission, queuing, and processing delays.LoadsNumbers of users
Networks traverse hostile environments
Noise damages dataLinks stop working
Best-effort networks have
Variable delaysVariable transmission ratesDiscarded packetsDuplicate packetsMaximum packet lengthReordered delivery
![Page 17: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/17.jpg)
17
Layering
Simplify the design Example- RPC
![Page 18: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/18.jpg)
18
result FI RE (#, target, action) procedure FIRE (nmiss, where, react)
Client stub Service stub
proc: FIRE
args: 3
type: integervalue: 2
type: string
value: “Lucifer”
type: procedure
value: EVADE
Preparerequestmessage.Send toservice
Receiverequestmessage.Callrequestedprocedure.Prepareresponsemessage.Send to client.
response:
acknowledgmenttype: stringvalue: “destroyed”
request:
Wait forresponse.
return result...
Client-server communication based on RPC
![Page 19: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/19.jpg)
19
Main program called procedureapplication protocol
RPC client stub presentation protocol RPC service stub
![Page 20: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/20.jpg)
20
Client network Service networktransport protocol package package
fire
send_ receive_
(return) fire(return)
Main program called procedureapplication protocol
RPC client stub presentation protocol RPC service stub
message messagereceive_message
send_message
![Page 21: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/21.jpg)
21
Layer One
Layer Two
Layer Three
A B C D
X Y Z
J K L
Example of layered design
![Page 22: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/22.jpg)
22
LinkLayer link
protocollink
protocol
link 1 link 2
LI NK_SEND (pkt, link2)
LinkLayer
LinkLayer
A B C
DATA
DATA LHLT
NETW ORK_HANDLE
Data link layer
![Page 23: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/23.jpg)
23
LinkLayer
linkprotocol
link 2
lI NK_SE ND (packet, link2)
LinkLayer
LinkLayer
NetworkLayer
NETW ORK_ SEND (segment, “IP”, nap_1197)
network
protocolNetworkLayer
LINK_SEND (packet, link5)
link5
DATA
DATANT NH
DATANT NH LHLT
NETWORK_HANDLE
Network layer
![Page 24: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/24.jpg)
24
LinkLayer
NetworkLayer
FI RE (7, “Lucifer”, evade)
end-to-end
protocol
End-to-EndLayer
DATA
DATANT NH LHLT
LinkLayer
LinkLayer
LinkLayer
NetworkLayer
NetworkLayer
End-to-EndLayer
ET EH
DATAET EH
(RPC) (RPC)
DATANT NHET EH
FI RE (7, “Lucifer”, evade)
End-to-end (transport) layer
![Page 25: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/25.jpg)
25
How many layers should a network model have?
OSI –has 7 layers Internet is based on a model including
Application Transport Network Data Link Physical Layer
Applications are very diverse and it makes no sense for a lower layer to implement functions required by higher layers.
The end-to-end argument application knows best
![Page 26: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/26.jpg)
26
Network composition
Mapped composition some layers of a network are composed of basic data-link, network, and transport layers of another network.
Overlay networks Internetworking interconnect several networks together, e.g., the
Internet
![Page 27: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/27.jpg)
27
Gnutella (network layer)
InternetTransport Protocol (end-to-end layer)
Internet Protocol (network layer)
dial-up dialed connection (end-to-end layer)
telephone switch (network layer)physical wire (link layer)
File Transfer Program (end-to-end layer)File transfer system
(linklayer)
telephone network(link
layer)
Network composition. The overlay network Gnutella uses for its link layer an end-to-end transport protocol of the Internet. In turn, the Internet uses for one of its links an end-to-end transport protocol of a dial-up phone system
![Page 28: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/28.jpg)
28
More about the link layer
Function: push bits from one place to another Analog worlds Capacity of a communication channel Capacity of a noisy communication channel
C= B x log (1+ signal/noise)
B is the bandwidth in Hz
signal/noise – ratio of signal power to noise power Signals attenuation Signals are distorted over long distances
![Page 29: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/29.jpg)
29
time
V1 1 1 1 10 0 0 0
Serial transmission
![Page 30: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/30.jpg)
30
data
ready
acknowledgeA B
How to push bits from A to B which do not share the same clock? First raise the READY line
![Page 31: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/31.jpg)
31
A B
Signal attenuation and shape distortion
![Page 32: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/32.jpg)
32
Framing
A pattern of bits serve as a frame delimiter – e.g., seven 1’s Bit stuffing:
The sender: add a 0 whenever it encounters a pattern of six 1’s in data The receiver: remove a 0 following a pattern of six 1’s in data
Add a frame header Add a frame trailer
![Page 33: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/33.jpg)
33
procedure FRAME _ TO_ BIT ( frame_data, length)ones_in_a_row = 0for i from 1 to length do // First send frame contents
SEND _BIT ( frame_data[ i]);if frame_data[ i] = 1 then
ones_in_a_row ones_in_a_row + 1;if ones_in_a_row = 6 then
SEND _BIT (0); // Stuff a zero so that data doesn’t ones_in_a_row 0; // look like a framing marker else
ones_in_a_row 0;for i from 1 to 7 do // Now send framing marker.
SEND _BIT (1)
Sender bit stuffing procedure
![Page 34: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/34.jpg)
34
procedure BIT _ TO_FRAME (rcvd_bit)ones_in_a_row integer initially 0if ones_in_a_row < 6 then
bits_in_frame bits_in_frame + 1frame_data[bits_in_frame] rcvd_bit
if rcvd_bit = 1 then ones_in_a_row ones_in_a_row + 1else ones_in_a_row 0
else // This may be a seventh one-bit in a row, check it out.if rcvd_bit = 0 then
ones_in_a_row 0 // Stuffed bit, don't use it.else // This is the end-of-frame marker
LINK _RECEIVE ( frame_data, ( bits_in_frame - 6), link_id)bits_in_frame 0ones_in_a_row 0
Receiver bit stuffing procedure
![Page 35: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/35.jpg)
35
Network protocol
Standard Highrobustnessprotocolprotocol
Network Layer
Link LayerExperimentalprotocol
A network protocol may use multiple data link protocols
![Page 36: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/36.jpg)
36
Network Layer
Link Layer
InternetProtocol
AppletalkProtocol
PathVector
ExchangeProtocol
AddressResolution
Protocol
Standard Highrobustness
protocolprotocolExperimental
protocol
Multiple transport and data link protocols
![Page 37: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/37.jpg)
37
structure frame structure checked_contents
bit_string net_protocol // multiplexing parameterbit_string payload // payload data
bit_string checksum
procedure LINK _SEND (data_buffer, link_identifier, link_protocol, network_protocol) frame instance outgoing_frameoutgoing_frame.checked_contents.payload data_bufferoutgoing_frame.checked_contents.net_protocol data_buffer.network_protocolframe_length LENGTH (data_buffer) + header_lengthoutgoing_frame.checksum CHECKSUM ( frame.checked_contents, frame_length)sendproc link_protocol[that_link.protocol] // Select link protocol.sendproc (outgoing_frame, frame_length, link_identifier) // Send frame.
Sending a frame
![Page 38: COP 5611 Operating Systems Spring 2010](https://reader035.vdocuments.site/reader035/viewer/2022062520/56815b20550346895dc8dd13/html5/thumbnails/38.jpg)
38
procedure LINK _RECEIVE (received_frame, length, link_id) frame instance received_frame if CHECKSUM (received_frame.checked_contents, length) =
received_frame.checksum then // Pass good packets up to next layer.
good_frame_count good_frame_count + 1;GIVE _TO_NETWORK _HANDLER (received_frame.checked_contents.payload,
received_frame.checked_contents.net_protocol);else bad_frame_count bad_frame_count + 1 // Just count damaged frame.
// Each network layer protocol handler must call SET_HANDLER before the first packet // for that protocol arrives…
procedure SET _HANDLER (handler_procedure, handler_protocol) net_handler[handler_protocol] handler_procedure
procedure GIVE _TO_NETWORK _HANDLER (received_packet, network_protocol) handler net_handler[network_protocol]if (handler ° NULL) call handler(received_packet, network_protocol)else unexpected_protocol_count unexpected_protocol_count + 1
Receiving a frame