Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
ELEN602 Lecture 2 • Review of Last Lecture • Layering 1 Communication Networks • Many forms of communication networks around – Postal mail, telephone, Internet etc. • Generic steps involved in communication – Addressing, name-to-address translation, transport, routing, delivery • Forms of delivery – Reliable, in-order – Unreliable, no acknowledgement 2 Steps in Web Surfing 1. 2. 3. 4. 5. 6. The user clicks on a link to indicate which document is to be retrieved. The browser must determine the address that contains the document. It does this by sending a query to its local name server. Once the address is known the browser establishes a connection to the specified machine, usually a TCP connection. In order for the connection to be successful, the specified machine must be ready to accept TCP connections. The browser runs a client version of HTTP, which issues a request specifying both the name of the document and the possible document formats it can handle. The machine that contains the requested document runs a server version of HTTP. It reacts to the HTTP request by sending an HTTP response which contains the desired document in the appropriate format. The TCP connection is then closed and the user may view the document. 3 Application level View Request HTTP client HTTP server Response 4 Steps in HTTP Transfer • User selects document • Networking software locates the remote machine address & establishes a 2-way connection • HTTP client sends request for document (GET ) • HTTP daemon on remote machine interprets the GET message • Remote HTTP daemon sends the result of GET operation – Result code, Description of the information, requested file • Remote HTTP daemon disconnects the connection • HTTP client displays the HTML content in the browser. 5 Domain Name Service • DNS servers help resolve name-to-address translation – Given a name such as ee.tamu.edu, find its IP address • IP addresses = telephone numbers in phone network • Machines (computers/network elements) know each other by IP addresses • IP addresses are 32bits in IPv4. • DNS protocol allows name-to-IP address resolution – Similar to phone directory assistance (411 or 555-1212) 6 DNS Example (cont’d) • QNAME = ee.tamu.edu, QCLASS = IN QTYPE = A • QNAME = ee.tamu.edu QCLASS = IN QTYPE = A – IN A 165.91.241.199 • The application will now use 165.91.241.199 whenever it needs to contact ee.tamu.edu 7 A more detailed view - Transport protocol HTTP server HTTP client Ephemeral Port 80 Port # GET 80, # TCP TCP #, 80 STATUS 8 Email and SMTP • Web transfers use HTTP, email uses SMTP (Simple Mail Transfer Protocol) - Application level protocols • Sender - Local SMTP Server -- Remote SMTP Server Receiver • SMTP uses Port 25, HTTP uses port 80 • POP (Post Office Protocol) may be used if receiver not on all the time. 9 • • • • • • • • • • • • Sender establishes TCP Connection to SMTP server Sends HELO message -identifying itself to SMTP server Client sends sender’s email address SMTP server acknowledges with 250 if successful Client sends receiver’s email address SMTRP server acknowledges with 250 Client sends a DATA message - requesting permission to send email message SMTP server sends OK-to-send message Client transfers the email message SMTP server returns ack with a message ID Client indicates that the transfer is complete. SMTP confirms the receipt of End-of-transfer message 10 Abstract View n-PDUs n n entity entity 11 Layering in General n+1 entity n+1 entity n-SDU n-SDU n-SAP n-SAP n-SDU H n entity n entity H n-SDU n-PDU 12 Data Units at different layers (a) n-PDU (b) Segmentation Reassembly n-SDU n-SDU n-PDU n-PDU n-PDU Blocking n-SDU n-SDU n-PDU n-PDU n-PDU Unblocking n-SDU n-SDU n-SDU n-SDU n-PDU 13 OSI Seven-layer Model Application A Application B Application Layer Application Layer Presentation Layer Presentation Layer Session Layer Session Layer Transport Layer Communication Network Transport Layer Network Layer Network Layer Network Layer Network Layer Data Link Layer Data Link Layer Data Link Layer Data Link Layer Physical Layer Physical Layer Physical Layer Physical Layer Electrical and/or Optical Signals 14 Packet-Switched Network PS = packet switch C PS C C = computer PS PS PS C C C 15 An Internetwork net 3 G net 1 G G G net 2 net 5 G net 4 G G = gateway/router 16 Headers and Trailers Application A data Application Layer data Transport Layer data Network Layer Physical Layer data dt Presentation Layer ph data Session Layer Application Layer ah data Presentation Layer Data Link Layer Application B data bits sh Session Layer th Transport Layer Network Layer nh dh Data Link Layer Physical Layer 17 TCP/IP Network Architecture Application Layer Transport Layer Internet Layer Network Interface (a) Application Layer Transport Layer Internet Layer Network Interface (b) 18 IP Layer and Network Interface Layer Machine B Machine A Application Application Transport Router/Gateway Transport Internet Internet Internet Network Interface Network Interface Network 1 Network Interface Network 2 19 IP Hour-Glass Protocol Graph HTTP SMTP RTP DNS TCP UDP IP Network Network Network Interface 1 Interface 2 Interface 3 20 (a) (1,1) (2,1) (2,2) router s Ethernet PPP (1,3) r w (1,2) (b) Server HTTP PC HTTP TCP Router IP IP IP Net Interface Net Interface Net Interface Ethernet TCP PPP 21 IP Datagram on an Ethernet IP Header Header contains source and destination physical addresses; network protocol type Ethernet Header Frame Check Sequence 22 HTTP Request Header contains source and destination port numbers Header contains source and destination IP addresses; transport protocol type Header contains source and destination physical addresses; network protocol type Ethernet Header TCP Header IP Header Frame Check Sequence 23 socket interface Application 1 Application 2 user user kernel kernel Socket socket interface Socket Underlying communication Protocols Underlying communication Protocols Communications network 24 Server socket() bind() listen() Client accept() blocks until server receives a connect request from client read() write() close() socket() connect negotiation connect() data write() data read() close() 25 Server socket() Client socket() bind() bind() recvfrom() blocks until server receives data from client data sendto() data sendto() recvfrom() close() close() 26 User Interface Control Server PI Server DTP Server FTP Connection Data User PI User DTP Connection User FTP PI = Protocol interpreter DTP = Data transfer process 27 C:\WINDOWS>ping nal.toronto.edu Pinging nal.toronto.edu [128.100.244.3] with 32 bytes of data: Reply Reply Reply Reply from from from from 128.100.244.3: 128.100.244.3: 128.100.244.3: 128.100.244.3: bytes=32 bytes=32 bytes=32 bytes=32 time=118ms time=118ms time=118ms time=118ms TTL=243 TTL=243 TTL=243 TTL=243 C:\WINDOWS> 28