Download presentation
Presentation is loading. Please wait.
Published byGiles Richard Modified over 8 years ago
1
Datornätverk A – lektion 14: Applikationslagret Kap 24: Sockets Kapitel 25: DNS Kapitel 26: SMTP och FTP Kapitel 27: HTTP och WWW
2
Application Layer PART VI
3
Position of application layer
4
Chapter 24 Client-Server Model: Socket Interface
5
Figure 22.5 Socket address A socket is a data flow between two processes that is identified by its socket address pair, i.e. a unique combination of: - Transport protocol (UDP or TCP). - Source IP address and port number. - Destination IP address and port number.
6
Figure 24.2 Client-server relationship
7
Figure 24.3 Connectionless iterative server
8
Figure 24.4 Connection-oriented concurrent server
9
Figure 24.6 Socket types
10
Figure 24.7 Socket interface for connectionless iterative server
11
Figure 24.8 Socket interface for connection-oriented concurrent server
12
Chapter 25 DNS = Domain Name System
13
Figure 25.1 Domain name space
14
Domain Name System - DNS En distribuerad databas som används till att koppla IP- nummer till textbaserade internetadresser. Ex www.gb.se 195.7.73.37 Varje sökning utgår från någon av rootservrarna som håller ordning på toppdomänerna. (.com.edu.se m fl) All information rörande en domän ligger i den ”Name Server” som hanterar domänen. För att lägga upp en ny domän krävs ”tillstånd” från närmast högre
15
Figure 25.2 Domain names and labels
16
Figure 25.4 Domains
17
Figure 25.5 Hierarchy of name servers
18
A primary DNS server loads all information from the disk file; the secondary server loads all information from the primary server. Note:
19
Figure 25.7 DNS in the Internet
20
Table 25.1 Generic domain labels LabelDescription.comCommercial organizations.eduEducational institutions.govGovernment institutions.intInternational organizations.milMilitary groups.netNetwork support centers.orgNonprofit organizations
21
Table 25.2 New generic domain labels LabelDescription.aeroAirlines and aerospace companies.bizBusinesses or firms (similar to com).coopCooperative business organizations.infoInformation service providers.museumMuseums and other nonprofit organizations.namePersonal names (individuals).proProfessional individual organizations
22
Figure 25.9 Country domains
23
Figure 25.10 Inverse domain
24
Figure 25.11 Recursive resolution
25
Figure 25.12 Iterative resolution
26
Figure 25.13 Query and response messages
27
Figure 25.14 Header format
28
DNS can use the services of UDP or TCP, using the well-known port 53. Note:
29
Elektronisk Postvia SMTP, POP eller IMAP Konferenssystem via USENET News och NNTP Fildelningvia t.ex NFS Filöverföringvia t.ex FTP Skrivardelning World Wide Webvia HTTP MassutsändningarMbone- Multicast Backbone LAN Tjänster
30
Chapter 26 Internet E-mail
31
Figure 26.10 Email delivery
32
Figure 26.11 POP3
33
Figure 26.1 Format of an email
34
Figure 26.2 Email address
35
Figure 26.3 User agent
36
Figure 26.4 MIME
37
Figure 26.5 MIME header
38
Table 26.1Data types and subtypes in MIME TypeSubtypeDescription TextPlainUnformatted text Multiport MixedBody contains ordered parts of different data types ParallelSame as above, but no order DigestSimilar to mixed, but the default is message/RFC822 AlternativeParts are different versions of the same message Message RFC822Body is an encapsulated message PartialBody is a fragment of a bigger message Ext. BodyBody is a reference to another message Image JPEGImage is in JPEG GIFImage is in GIF format VideoMPEGVideo is in MPEG format AudioBasicSingle-channel encoding of voice at 8 KHz Application PostScriptAdobe PostScript Octet-StreamGeneral binary data (8-bit bytes)
39
Table 26.2 Content-transfer encoding CategoryDescription Type ASCII characters and short lines 7bitNon-ASCII characters and short lines 8bitNon-ASCII characters with unlimited-length lines Binary6-bit blocks of data are encoded into 8-bit ASCII characters Base64Non-ASCII characters are encoded as an equal sign followed by an ASCII code
40
Figure 26. 6 Base64
41
Table 26.3 Base64 encoding table ValueCodeValueCodeValueCodeValueCodeValueCodeValueCode 0A11L22W33h44s 55 3 1B12M23X34i45t 56 4 2C13N24Y35j46u 57 5 3D14O25Z36k47v 58 6 4E15P26a37l48w 59 7 5F16Q27b38m49x 60 8 6G17R28c39n50y 61 9 7H18S29d40o51z 62 + 8I19T30e41p520 63 / 9J20U31f42q531 10K21V32g43r542
42
Figure 26.7 Quoted-printable
43
Figure 26.8 Email client and server
44
26.2 File Transfer Connections Communication File Transfer User Interface Anonymous
45
FTP uses the services of TCP. It needs two TCP connections. The well-known port 21 is used for the control connection, and the well-known port 20 is used for the data connection. Note:
46
Figure 26.12 FTP
47
Figure 26.13 Using the control connection
48
Figure 26.14 Using the data connection
49
Figure 26.15 File transfer
50
Example 1 Figure 26.16 (next slide) shows an example of how a file is stored. 1.The control connection is created, and several control commands and responses are exchanged. 2.Data are transferred record by record. 3.A few commands and responses are exchanged to close the connection.
51
Figure 26.16 Example 1
52
Table 26.4 List of FTP commands in UNIX Commands !, $, account, append, ascii, bell, binary, bye, case, cd, cdup, close, cr, delete, debug, dir, discount, form, get, glob, hash, help, lcd, ls, macdef, mdelete, mdir, mget, mkdir, mls, mode, mput, nmap, ntrans, open, prompt, proxy, sendport, put, pwd, quit, quote, recv, remotehelp, rename, reset, rmdir, runique, send, status, struct, sunique, tenex, trace, type, user, verbose,?
53
Example 2 We show some of the user interface commands that accomplish the same task as in Example 1. The user input is shown in boldface. As shown below, some of the commands are provided automatically by the interface. The user receives a prompt and provides only the arguments. $ ftp challenger.atc.fhda.edu Connected to challenger.atc.fhda.edu 220 Server ready Name: forouzan Password: xxxxxxx ftp > ls /usr/user/report 200 OK 150 Opening ASCII mode........... 226 transfer complete ftp > close 221 Goodbye ftp > quit
54
Example 3 We show an example of using anonymous FTP. We connect to internic.net, where we assume there are some public data available. $ ftp internic.net Connected to internic.net 220 Server ready Name: anonymous 331 Guest login OK, send "guest" as password Password: guest ftp > pwd 257 '/' is current directory ftp > ls 200 OK 150 Opening ASCII mode bin... ftp > close 221 Goodbye ftp > quit
55
Chapter 27 HTTP and WWW
56
HTTP uses the services of TCP on well-known port 80. Note:
57
Figure 27.1 HTTP transaction
58
Figure 27.9 Example 1
59
Example 1 This example retrieves a document. We use the GET method to retrieve an image with the path /usr/bin/image1. The request line shows the method (GET), the URL, and the HTTP version (1.1). The header has two lines that show that the client can accept images in GIF and JPEG format. The request does not have a body. The response message contains the status line and four lines of header. The header lines define the date, server, MIME version, and length of the document. The body of the document follows the header (see Fig. 27.9, next slide).
60
Figure 27.3 Request line
61
Figure 27.4 URL
62
Figure 27.6 Status line
63
Figure 27.7 Header format
64
Figure 27.10 Example 2
65
Example 2 This example retrieves information about a document. We use the HEAD method to retrieve information about an HTML document (see the next section). The request line shows the method (HEAD), URL, and HTTP version (1.1). The header is one line showing that the client can accept the document in any format (wild card). The request does not have a body. The response message contains the status line and five lines of header. The header lines define the date, server, MIME version, type of document, and length of the document (see Fig. 27.10, next slide). Note that the response message does not contain a body.
66
HTTP version 1.1 specifies a persistent connection by default. Note:
67
Figure 27.12 Hypertext
68
Figure 27.11 WWW Hyperlinks
69
Figure 27.13 Browser architecture
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.