Networking Principles      IT1 Course Slide         Instructor:       Majid Taghiloo
Functionality    • Transport layer and layers below      – B i communication        Basic       i ti      – Reliability   ...
Dichotomy of Duties    • Network      – Transfers bits      – Operates at application s request                     applic...
Important Point    Although an internet system provides a                                  ,    p    basic communication s...
How Two Application Programs Make                 Contact• One application     – Begins execution first         g     – Wa...
Client‐Server        Client Server Paradigm• Used by all network applications• Passive program called a server• Active pro...
Internet Communication    All network applications use a form of     communication known as the client‐server     paradigm...
Characteristics of a Client•   Arbitrary application program•   Becomes client temporarily•   Can also perform other compu...
Characteristics of a Server•   Special‐purpose, privileged program•   Dedicated to providing one service•   Can handle mul...
Terminology• Server     – An executing program that accepts contact over                  gp g               p       the n...
Direction of Data Flow• Data can fl           flow     – From client to server only     – From server to client only     –...
Key IdeaAlthough the client initiates contact, information can flow in either or both information can flow in either or bo...
Clients, Servers,     Clients Servers and Other Protocols     Clients and servers are application programs •13
Server CPU Use• Facts     – Server operates like other applications        • Uses CPU to execute instructions        • Per...
Multiple Services• Can have multiple servers on single computer• Servers only use processor when handling a  request• P  P...
Illustration of Multiple Servers• Each server offers one service• One server can handle multiple clients16
Identifying a Service• Protocol port number used         l          b      d• Each service given unique p number, P       ...
The Point About PortsTransport protocols assign each service a unique port identifier.  A server must specify unique port ...
In Theory• Port numbers are merely integers• Any server could use any port number19
In Practice     • P t l port numbers used as service       Protocol    t   b      d       i       identifiers     • Need u...
Terminology• Sequential program     – Typical of most programs        yp             p g     – Single thread of control• C...
Servers and Concurrency• Sequential server     – Also called iterative     – Handles one request at a time• C  Concurrent ...
Delay in Servers     • Concurrent server        – Server creates new thread of control to handle each request        – Cli...
Concurrency in ServersConcurrent execution is fundamental to servers because concurrency permits servers because concurren...
Protocol Ports and Concurrent Servers• Apparent problem     – One port number assigned to each service            p       ...
Protocol Ports and Concurrent Servers             (continued)• Solution to problem: use i f     l i          bl         in...
Demultiplexing in a Concurrent ServerTransport protocols assign an identifier to Transport protocols assign an identifier ...
Variations on a Theme• A server can use     – Connectionless transport (UDP)     – Connection‐oriented transport (TCP)    ...
Variations on a Theme (cont)• A server can     – Maintain interaction with a client for days or hours                     ...
Example of Circularity• Time server   i     – Returns time of day• File server     – Allows client to read or write a file...
Interacting with Protocol Software                   g     •   Client or server uses transport protocols     •   Protocol ...
Application Program Interface• Part of operating system• Permits application to use protocols• Defines     – Operations al...
Upcoming SlideShare
Loading in …5
×

Lecture2

306
-1

Published on

Network principles for IT1 Course

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
306
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
4
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Lecture2

  1. 1. Networking Principles IT1 Course Slide Instructor: Majid Taghiloo
  2. 2. Functionality • Transport layer and layers below – B i communication Basic i ti – Reliability • Application layer – Abstractions • Files • Services • Databases – Names2
  3. 3. Dichotomy of Duties • Network – Transfers bits – Operates at application s request application’s • Applications determine – What to send – When to send – Where to send – Meaning of bits3
  4. 4. Important Point Although an internet system provides a  , p basic communication service, the protocol  software cannot initiate contact with, or  p f , p accept contact from, a remote computer.   Instead, two application programs must  participate in any communication: one  participate in any communication: one application initiates communication and  the other accepts it. the other accepts it.4
  5. 5. How Two Application Programs Make Contact• One application – Begins execution first g – Waits passively at prearranged location• A th application Another li ti – Begins execution later – Actively contacts first program• Called client‐server interaction5
  6. 6. Client‐Server Client Server Paradigm• Used by all network applications• Passive program called a server• Active program called a client6
  7. 7. Internet Communication All network applications use a form of  communication known as the client‐server  paradigm.  A server application waits  p passively for contact, while a client  yf , application initiates communication  actively.7
  8. 8. Characteristics of a Client• Arbitrary application program• Becomes client temporarily• Can also perform other computations• Invoked directly by user• Runs locally on user’s computer user s• Actively initiates contact with a server• Contacts one server at a time8
  9. 9. Characteristics of a Server• Special‐purpose, privileged program• Dedicated to providing one service• Can handle multiple remote clients simultaneously• Invoked automatically when system boots y y• Executes forever• Needs powerful computer and operating system• Waits passively for client contact• Accepts requests from arbitrary clients9
  10. 10. Terminology• Server – An executing program that accepts contact over gp g p the network• Server class computer Server‐class – Hardware sufficient to execute a server• Informally – Term server often applied to computer10
  11. 11. Direction of Data Flow• Data can fl flow – From client to server only – From server to client only – In both directions• Application protocol determines flow• Typical scenario – Client sends request(s) – Sever sends response(s)11
  12. 12. Key IdeaAlthough the client initiates contact, information can flow in either or both information can flow in either or bothdirections between a client and server.  Many services arrange for the client to send one or more requests and the server to return one response for each request.12
  13. 13. Clients, Servers, Clients Servers and Other Protocols Clients and servers are application programs •13
  14. 14. Server CPU Use• Facts – Server operates like other applications • Uses CPU to execute instructions • Performs I/O operations – Waiting for data to arrive over a network does not require CPU time• Consequence – Server program only uses CPU when servicing a p g y g request14
  15. 15. Multiple Services• Can have multiple servers on single computer• Servers only use processor when handling a request• P Powerful h d f l hardware required to h dl many i d handle services simultaneously15
  16. 16. Illustration of Multiple Servers• Each server offers one service• One server can handle multiple clients16
  17. 17. Identifying a Service• Protocol port number used l b d• Each service given unique p number, P g q port• Server – Informs OS it is using port P – Waits for requests to arrive• Cli Client – Forms request – Send request to port P on server computer17
  18. 18. The Point About PortsTransport protocols assign each service a unique port identifier.  A server must specify unique port identifier A server must specifythe identifier when it begins execution.  A client must specify the identifier when it client must specify the identifier when itrequests transport protocol software to contact a server.  Protocol software on the server computer uses the identifier to direct an incoming request to the correct server.18
  19. 19. In Theory• Port numbers are merely integers• Any server could use any port number19
  20. 20. In Practice • P t l port numbers used as service Protocol t b d i identifiers • Need uniform numbering – To allow arbitrary client to contact server on arbitrary machine – To avoid inventing “directory assistance” mechanism • Port numbers – Uniform throughout Internet – Set by standards bodies20
  21. 21. Terminology• Sequential program – Typical of most programs yp p g – Single thread of control• C Concurrent program t – Multiple threads of control – Execution proceeds “in parallel” – More difficult to create21
  22. 22. Servers and Concurrency• Sequential server – Also called iterative – Handles one request at a time• C Concurrent server t – Can handle multiple requests at a time – No waiting22
  23. 23. Delay in Servers • Concurrent server – Server creates new thread of control to handle each request – Client only waits for its request to be processed • Sequential server – Client waits for all previous requests to be processed as well as f it request t b processed for its t to be d – Unacceptable to user if long request blocks short requests23
  24. 24. Concurrency in ServersConcurrent execution is fundamental to servers because concurrency permits servers because concurrency permitsmultiple clients to obtain a given service without having to wait for the server to without having to wait for the server tofinish previous requests.  In a concurrent server, the main server thread creates a new service thread to handle each client.24
  25. 25. Protocol Ports and Concurrent Servers• Apparent problem – One port number assigned to each service p g – Concurrent server has multiple copies (threads) running – Client and server may interact – Messages sent to server’s port must be delivered ’ b d li d to correct copy25
  26. 26. Protocol Ports and Concurrent Servers (continued)• Solution to problem: use i f l i bl information about i b client as well as server to deliver incoming packets• TCP uses four items to identify connection y – Server’s IP address – Server’s protocol port number Server s – Client’s IP address – Client’s protocol port number Client s26
  27. 27. Demultiplexing in a Concurrent ServerTransport protocols assign an identifier to Transport protocols assign an identifier toeach client as well as to each service.  Protocol software on the server s machine Protocol software on the server’s machineuses the combination of client and server identifiers to choose the correct copy of a identifiers to choose the correct copy of aconcurrent server.27
  28. 28. Variations on a Theme• A server can use – Connectionless transport (UDP) – Connection‐oriented transport (TCP) – Both for a single service g• A single server can offer multiple services – Often used for “trivial” services trivial – Server uses multiple port numbers simultaneously28
  29. 29. Variations on a Theme (cont)• A server can – Maintain interaction with a client for days or hours y – Send a short response and terminate interaction – Perform I/O on the local computer – Become a client for another service (potential cycle problem) l bl )29
  30. 30. Example of Circularity• Time server i – Returns time of day• File server – Allows client to read or write a file – Calls time server when generating time stamp for file• Suppose programmer modifies time server to log requests to a file30
  31. 31. Interacting with Protocol Software g • Client or server uses transport protocols • Protocol software inside OS • Applications outside OS • Mechanism needed to bridge the two – Called Application Program Interface (API)31
  32. 32. Application Program Interface• Part of operating system• Permits application to use protocols• Defines – Operations allowed – Arguments for each operation g p32

×