Prof Dr Ing Jochen Schiller Computer Systems Telematics

  • Slides: 31
Download presentation
Prof. Dr. -Ing. Jochen Schiller Computer Systems & Telematics TI III: Operating Systems &

Prof. Dr. -Ing. Jochen Schiller Computer Systems & Telematics TI III: Operating Systems & Computer Networks Example Prof. Dr. -Ing. Jochen Schiller Computer Systems & Telematics Freie Universität Berlin, Germany TI 3: Operating Systems and Computer Networks 14. 1

Content 8. Networked Computer & Internet 9. Host-to-Network 10. Internetworking 11. Transport Layer 12.

Content 8. Networked Computer & Internet 9. Host-to-Network 10. Internetworking 11. Transport Layer 12. Applications 13. Network Security 14. Example TI 3: Operating Systems and Computer Networks 14. 2

A Comprehensive Example What happens if one presses a key on the computer? ?

A Comprehensive Example What happens if one presses a key on the computer? ? What if that key causes an web page to be displayed? ? TI 3: Operating Systems and Computer Networks 14. 3

Keyboard Interrupt Keyboard controller raises interrupt flag CPU interrupts execution of current process and

Keyboard Interrupt Keyboard controller raises interrupt flag CPU interrupts execution of current process and starts Interrupt Service Routine (ISR) - Unconditional jump TI 3: Operating Systems and Computer Networks 14. 4

Keyboard Interrupt Handling ISR processes input from keyboard - Clears interrupt flag - Transfers

Keyboard Interrupt Handling ISR processes input from keyboard - Clears interrupt flag - Transfers data from device into buffer - Establishes owner of device - Triggers notification of user process TI 3: Operating Systems and Computer Networks 14. 5

In the Meantime… Web browser is one of many processes running locally Other processes

In the Meantime… Web browser is one of many processes running locally Other processes include - Other user processes (possibly of different users) - System processes implementing system services - Kernel processes TI 3: Operating Systems and Computer Networks 14. 6

Web Browser Process in Detail Web browser processes ØCurrently waiting for input - E.

Web Browser Process in Detail Web browser processes ØCurrently waiting for input - E. g. using select() ØProcess state blocked TI 3: Operating Systems and Computer Networks 14. 7

Reaction to External Event 1. ISR changes process state to ready 2. Scheduling algorithm

Reaction to External Event 1. ISR changes process state to ready 2. Scheduling algorithm eventually changes process state to running 2. 1. TI 3: Operating Systems and Computer Networks 14. 8

E (2) D (5) C (4) B (6) A (3) Process Scheduling is handled

E (2) D (5) C (4) B (6) A (3) Process Scheduling is handled by variety of scheduling algorithms - Non-preemptive / preemptive - Maximize throughput, responsiveness, etc. . . Processes may have priorities - Priority inversion due to lock on shared resources - Priority inheritance TI 3: Operating Systems and Computer Networks 14. 9

Web Browser Processes Event Assume input requires web browser to display a web page

Web Browser Processes Event Assume input requires web browser to display a web page with a given URL 1. String processing (user space) 2. Connect to server and retrieve necessary data (system calls) 3. Render web page (user space) 4. Update user interface (system calls) TI 3: Operating Systems and Computer Networks 14. 10

Client/Server Communication GET /inst/ag-tech/index. html HTTP/1. 1 Host: www. inf. fu-berlin. de Pragma: no-cache.

Client/Server Communication GET /inst/ag-tech/index. html HTTP/1. 1 Host: www. inf. fu-berlin. de Pragma: no-cache. . TI 3: Operating Systems and Computer Networks 14. 11

Layered Protocol Stack Web Browser Web Server Host corresponding to URL TI 3: Operating

Layered Protocol Stack Web Browser Web Server Host corresponding to URL TI 3: Operating Systems and Computer Networks 14. 12

Interaction Between Network Layers TCP ARP Host-to-Network Application Header Presentation Header Session Header Transport

Interaction Between Network Layers TCP ARP Host-to-Network Application Header Presentation Header Session Header Transport Header Application layer Presentation layer data NH Application layer data TH DLH data PH SH Network layer TI 3: Operating Systems and Computer Networks AH Transport layer Physical layer 2 User data Session layer Data link layer 3 NH Network Header DLH Data Link Header DLT Data Link Trailer sending AH PH SH TH - Lower layers treat upper layer packets as simple data - Headers contain control information for each layer ØRepeated encapsulation causes overhead ICMP IP - Each layer uses only services of layer directly below - Each layer provides services to layer directly above ØProtocol independence ØModularity Data encapsulation 4 receiving Layered protocol architecture UDP Session layer Transport layer data Network layer data bits Presentation layer DLT Data link layer Physical layer 14. 13

Uniform Resource Locator (URL) http: //cst. mi. fu-berlin. de/index. html http: Hypertext Transfer Protocol

Uniform Resource Locator (URL) http: //cst. mi. fu-berlin. de/index. html http: Hypertext Transfer Protocol (HTTP) - Protocol for accessing web pages and related content - Implies communication over port 80 (unless other port given in URL) cst. mi. fu-berlin. de: Host name - Resolved to IP address via Domain Name System (DNS) - cst. mi. fu-berlin. de -> 160. 45. 117. 167 index. html: Local resource name - Protocol specific parameter - Handled by web server TI 3: Operating Systems and Computer Networks 14. 14

Security: HTTP over TLS/SSL HTTPS authenticates server and establishes secure connection: 1) 2) 3)

Security: HTTP over TLS/SSL HTTPS authenticates server and establishes secure connection: 1) 2) 3) 4) 5) Propose SSL parameters, send random number Agree to parameters, send random number Send public key certificate Conclude handshake negotiation Send random number encrypted with server’s public key - 6) 7) 8) 9) 3 4 5 Server decrypts and verifies message Activate negotiated parameters Send encrypted hash over previous messages - 2 Client and server derive session key from all three random numbers Activate negotiated parameters Send encrypted hash over previous messages - 1 Client decrypts and verifies message Ø Proceed to exchange regular HTTP data over secure channel 6 7 8 9 Source: Cisco Systems. Application Control Engine Module SSL Configuration Guide TI 3: Operating Systems and Computer Networks 14. 15

Connection Setup / Transport Layer Client [SYN, seq=17] [SYN, seq=39, ACK=18] Reliable end-to-end connection

Connection Setup / Transport Layer Client [SYN, seq=17] [SYN, seq=39, ACK=18] Reliable end-to-end connection between processes Call to connect() initiates connection setup [seq=53, ACK=78, data=‚hi‘] [seq=78, ACK=55, data=‚ho‘] CLOSED Active open /SYN Passive open [FIN] LISTEN SYN/SYN + ACK/ACK ESTABLISHED Close /FIN ACK FIN_WAIT_2 FIN/ACK CLOSE_WAIT K FIN/ACK + FI N /A C K Close /FIN CLOSING ACK FIN/ACK TI 3: Operating Systems and Computer Networks SYN_SENT TIME_WAIT LAST_ACK Timeout after two segment lifetimes Time wait Close /FIN [ACK] Send/ SYN/SYN + ACK SYN_RCVD Data transfer Close AC Connection setup [seq=18, ACK=40] ØTCP 3 -way handshake ØConnection parameters FIN_WAIT_1 Server [FIN] [ACK] Connection release ACK CLOSED 14. 16

Structure of Network Layer IP-Packet Congestion control (Explicit Congestion Notification) Qo. S class Bit

Structure of Network Layer IP-Packet Congestion control (Explicit Congestion Notification) Qo. S class Bit 0 3 ECN 7 Version Hdr. Len 15 31 Diff. Serv Identifier Time to Live 0 DF MF Total Length Flags Protocol Fragment Offset Header Checksum Source Address IP Header Diff. Serv Codepoint Don‘t Fragment Reserved More Fragments Destination Address Options and Padding Data TI 3: Operating Systems and Computer Networks 14. 17

Network Layer Routing (Local Scope) Globally unique per host addressing Routers maintain tables of

Network Layer Routing (Local Scope) Globally unique per host addressing Routers maintain tables of known networks - Optional route to default gateway Subnetting implements logical structure - Subnet mask builds hierarchy using host part of IP address - Limits broadcasts - More efficient routing Network topology may be part of security concept 160. 45. 114 Campus - Institute Router 160. 45. 113 Router 160. 45. 115 160. 45 Campus backbone 160. 45. 117 Router Internet TI 3: Operating Systems and Computer Networks 14. 18

Network Layer Routing (Global Scope) Internet organized into autonomous systems (AS) - Commonly, one

Network Layer Routing (Global Scope) Internet organized into autonomous systems (AS) - Commonly, one AS per major organization - Peering points to exchange data between ASs Intra-domain routing: OSPF, link state algorithm Inter-domain routing: BGPv 4, distance vector protocol - May involve non-technical routing choices Intra Domain Routing Inter Domain Routing Large company Consumer ISP 1 Backbone service provider 2 Small company 2 TI 3: Operating Systems and Computer Networks Small company 1 Peering point Consumer ISP 2 14. 19

Data Link Layer Communication (Local Scope) Congestion control (Explicit Congestion Notification) Don‘t Fragment Reserved

Data Link Layer Communication (Local Scope) Congestion control (Explicit Congestion Notification) Don‘t Fragment Reserved More Fragments Qo. S class Diff. Serv Codepoint Bit 0 3 Version 7 Hdr. Len ECN Diff. Serv Identifier Time to Live 0 15 DF MF Total Length Flags Protocol Fragment Offset Header Checksum Source Address 31 IP Header Transparent communication between two directly connected nodes Services include: framing, error control, connection maintenance, acknowledgements, flow control Destination Address Options and Padding Data TI 3: Operating Systems and Computer Networks 14. 20

Error Detection: Cyclic Redundancy Check (CRC) • Reception of a correct bit sequence: 11

Error Detection: Cyclic Redundancy Check (CRC) • Reception of a correct bit sequence: 11 0011 1001 ÷ 1 1001 = 10 0001 (mod 2) 11 00 0001 1 1001 0 0000 = remainder • No remainder, thus the received bits should be error free • Reception of a erroneous bit sequence: 11 1111 1000 ÷ 1 1001 = 10 1001 (mod 2) 11 00 1101 1 1100 1 0000 1 1001 0 1001 = remainder 0 • There is a remainder unequal 0, thus there was definitely a transmission error TI 3: Operating Systems and Computer Networks 14. 21

Errors During Transmission 0 1 Received data 0 1 Original data 0 1 Data

Errors During Transmission 0 1 Received data 0 1 Original data 0 1 Data 0 1 1 1 0 0 1 0 1 1 0 0 1 0 Signal Interference Signal with inter -ference Sampling Error! TI 3: Operating Systems and Computer Networks 14. 22

Physical Layer Wired transmission Twisted pair Packet / sequence of bits turned into physical

Physical Layer Wired transmission Twisted pair Packet / sequence of bits turned into physical signal Signal propagation depends on physical medium (limited bandwidth, attenuation, dispersion) and background noise Mapping between bits and (multi-valued) symbols Baseband transmission vs. modulation (broadband transmission) Wave guide Coaxial cable Optical fibers Hz 103 105 107 109 Long wave Short wave Classical radio TV 1011 Micro waves 1013 1015 Infra red Visible light Wireless transmission Twisted pair Copper core Insulation Coaxial Copper core Insulation Shielding Insulation and mechanical protection Optical fiber LED Laser diode Glas core Protective layers TI 3: Operating Systems and Computer Networks 14. 23

Client/Server Communication GET /inst/ag-tech/index. html HTTP/1. 1 Host: www. inf. fu-berlin. de Pragma: no-cache.

Client/Server Communication GET /inst/ag-tech/index. html HTTP/1. 1 Host: www. inf. fu-berlin. de Pragma: no-cache. . TI 3: Operating Systems and Computer Networks 14. 24

At the Server… Web server is one of many processes running locally ØUpon receiving

At the Server… Web server is one of many processes running locally ØUpon receiving packet, network interface controller (NIC) will raise interrupt ØKernel will handle the packet and notify the web server process TI 3: Operating Systems and Computer Networks 14. 25

Processing of HTTP-GET Request Web server retrieves file inst/agtech/index. html from local file system

Processing of HTTP-GET Request Web server retrieves file inst/agtech/index. html from local file system ØSystem calls to access secondary storage ØKernel maps file name to data layout on disk Web server sends data to client TI 3: Operating Systems and Computer Networks 14. 26

Server Replies to Client HTTP/1. 1 200 OK Date: Fri, 16 Feb 2007 11:

Server Replies to Client HTTP/1. 1 200 OK Date: Fri, 16 Feb 2007 11: 40: 34 GMT Server: Apache/1. 3. 6 (Unix) Transfer-Encoding: chunked Content-Type: text/html <HTML> Document according to HTML </HTML> TI 3: Operating Systems and Computer Networks 14. 27

Client Data Processing Client host receives packet Kernel hands data to web browser process

Client Data Processing Client host receives packet Kernel hands data to web browser process Web browser renders page Ø May have to allocate memory in the process Finally, browser updates user interface via system call TI 3: Operating Systems and Computer Networks 14. 28

A Comprehensive Example ! ! TI 3: Operating Systems and Computer Networks 14. 29

A Comprehensive Example ! ! TI 3: Operating Systems and Computer Networks 14. 29

Content 1. Introduction and Motivation 8. Networked Computer & Internet 2. Subsystems, Interrupts and

Content 1. Introduction and Motivation 8. Networked Computer & Internet 2. Subsystems, Interrupts and System Calls 9. Host-to-Network 3. Processes 10. Internetworking 4. Memory 11. Transport Layer 5. Scheduling 12. Applications 6. I/O and File System 13. Network Security 7. Booting, Services, and Security 14. Example TI 3: Operating Systems and Computer Networks 14. 30

Fin TI 3: Operating Systems and Computer Networks 14. 31

Fin TI 3: Operating Systems and Computer Networks 14. 31